Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add semantic conventions for redis receiver #2145

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ release.
([2100](https://github.com/open-telemetry/opentelemetry-specification/pull/2100))
- Add JVM memory runtime semantic
conventions. ([#2272](https://github.com/open-telemetry/opentelemetry-specification/pull/2272))
- Add `db.redis.instance` Resource attribute in Redis.
([#2145](https://github.com/open-telemetry/opentelemetry-specification/pull/2145))

### Compatibility

Expand Down
14 changes: 14 additions & 0 deletions semantic_conventions/resource/db/redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
groups:
- id: redis
prefix: db.redis
Copy link
Member

@joaopgrassi joaopgrassi Jan 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quickly searched and I didn't find another convention where the id is at a "different level" than the prefix. I'm not sure if this is a problem though, just something that stand up for me.

I guess you will also get a conflict if you have a structure like this: id: db > id: db.redis > attributes > id: instance? Similar to this


?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was getting conflicts while using id as db and db.redis.
As we already have db and db.redis as id value in database attributes, we cannot use the same here. Therefore we have kept id as redis.

brief: >
A redis instance
attributes:
- id: instance
type: string
brief: >
The reported name of the Redis instance. This can be in the form of
`{host}:{port}` or any other name provided manually while configuring
the instrumentation. If not provided, the default value is the `endpoint`
value provided in the configuration.
examples: ['localhost:6379', 'product_info_redis']
7 changes: 7 additions & 0 deletions specification/resource/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This document defines standard attributes for resources. These attributes are ty
- [Compute Unit](#compute-unit)
- [Compute Instance](#compute-instance)
- [Environment](#environment)
- [Database](#database)
- [Version attributes](#version-attributes)
- [Cloud-Provider-Specific Attributes](#cloud-provider-specific-attributes)

Expand Down Expand Up @@ -157,6 +158,12 @@ Attributes defining a running environment (e.g. Operating System, Cloud, Data Ce
- [Deployment Environment](./deployment_environment.md)
- [Kubernetes](./k8s.md)

## Database

Attributes defining a database service.

- [Redis](./db/redis.md)

## Version attributes

Version attributes, such as `service.version`, are values of type `string`. They are
Expand Down
13 changes: 13 additions & 0 deletions specification/resource/semantic_conventions/db/redis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Redis

**Status**: [Experimental](../../../document-status.md)

**type:** `db.redis`

**Description:** A redis instance

<!-- semconv redis -->
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `db.redis.instance` | string | The reported name of the Redis instance. This can be in the form of `{host}:{port}` or any other name provided manually while configuring the instrumentation. If not provided, the default value is the `endpoint` value provided in the configuration. | `localhost:6379`; `product_info_redis` | No |
<!-- endsemconv -->