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

Semantic Conventions - Multi-Registry Proposal #348

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
118e5f3
feat(multi-registry): Create first draft of the spec.
lquerel Aug 29, 2024
dba1a2c
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 29, 2024
6d08430
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 29, 2024
f075e43
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 29, 2024
7aa9129
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 29, 2024
e2bd4e0
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 30, 2024
97ed998
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 30, 2024
2050cc7
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 30, 2024
17f5b68
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 30, 2024
5cef1e2
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 30, 2024
e20011d
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 31, 2024
e963180
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 31, 2024
02e58eb
feat(multi-registry): Update draft of multi-registry spec.
lquerel Aug 31, 2024
2f04a35
Merge branch 'main' into multi-registry-spec
lquerel Aug 31, 2024
0a698de
Update multi_registry.md
lquerel Aug 31, 2024
fe45217
feat(multi-registry): Update draft of multi-registry spec.
lquerel Sep 3, 2024
d510fe3
Merge remote-tracking branch 'origin/multi-registry-spec' into multi-…
lquerel Sep 3, 2024
5562cef
feat(multi-registry): Update draft of multi-registry spec.
lquerel Sep 3, 2024
706f7dc
feat(multi-registry): Update draft of multi-registry spec.
lquerel Sep 7, 2024
b518c17
Merge branch 'main' into multi-registry-spec
lquerel Sep 7, 2024
422022f
feat(multi-registry): Update draft of multi-registry spec.
lquerel Sep 7, 2024
d5ab29d
Merge remote-tracking branch 'origin/multi-registry-spec' into multi-…
lquerel Sep 7, 2024
165f484
Merge branch 'main' into multi-registry-spec
lquerel Sep 8, 2024
21b5a5b
Merge branch 'main' into multi-registry-spec
lquerel Sep 9, 2024
5d68d7d
feat(multi-registry): uniqueness within groups is scoped by the type …
lquerel Sep 9, 2024
acb6b7b
Merge remote-tracking branch 'origin/multi-registry-spec' into multi-…
lquerel Sep 9, 2024
3d625ad
feat(multi-registry): dependency version can be a version number or l…
lquerel Sep 9, 2024
58d4f9d
chore(spec): Explain how Weaver will help resolving conflicts
lquerel Sep 11, 2024
f78e5a2
Merge branch 'main' into multi-registry-spec
lquerel Oct 1, 2024
d76f4ce
Merge branch 'main' into multi-registry-spec
lquerel Dec 9, 2024
f03db88
Merge branch 'open-telemetry:main' into multi-registry-spec
lquerel Jan 23, 2025
23cad64
chore(doc): Update the spec based on feedback.
lquerel Jan 23, 2025
04261dc
chore(doc): Update the spec based on feedback.
lquerel Jan 23, 2025
6d4cbb8
chore(doc): Update the spec based on feedback.
lquerel Jan 23, 2025
48a0ebc
chore(doc): Update the spec based on feedback.
lquerel Jan 24, 2025
46cd096
chore(doc): Update section OTEL Semantic Conventions Changes and Prob…
lquerel Jan 24, 2025
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
366 changes: 366 additions & 0 deletions docs/specs/multi-registry/multi_registry.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
imports:
- schema_url: https://opentelemetry.io/schemas/1.27.0
name: otel

groups:
- ref: otel:http.server.request.duration
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that reusing the same name across different signals is allowed and is a feature rather than a bug (e.g. dns.lookup.duration is a metric name, but if DNS lookup is reported as an event, it'd make a perfect event name, or if it's reported as attribute on something, it could be an attribute name).

So we need ref: to either reference a group id (and then give them some meaning) or reference a specific signal (ref_metric).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is not something currently allowed or even supported. You’re mentioning in this comment something you’d like us to explore. Is that correct?

Copy link
Contributor

@lmolkova lmolkova Sep 8, 2024

Choose a reason for hiding this comment

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

I'm talking about current state.

I can easily define an attribute with the same name as metric, there are no checks and nothing is going to stop me. Nothing would break if I do. And I consider it a feature, not a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad. It's now fixed. See 5d68d7d

Copy link
Contributor

Choose a reason for hiding this comment

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

I still think this one should be otel:metric.http.server.request.duration

https://github.com/open-telemetry/semantic-conventions/blob/06395f47d5ffc01d91ef6abe238fe56e941e7e9f/model/http/metrics.yaml#L39

so the ref is based on the group id (which is guaranteed to be unique) and not on the name (which could be reused across signals)

attributes:
- ref: otel:http.request.method
requirement_level: required
- ref: otel:client.address
requirement_level: required
- ref: otel:client.port
requirement_level: required
- ref: otel:thread.id
requirement_level: required
- ref: route.name
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
groups:
- id: registry.acme_http_server
type: attribute_group
display_name: Custom attributes for ACME HTTP Server
brief: 'A set of specific attributes for ACME HTTP Server.'
attributes:
# The ACME HTTP server author does not use the standard `http.route` for an unknown reason.
# Unfortunately, we cannot avoid this. In the future, we could enhance Weaver to detect these
# types of similarities and report them as advice messages.
- id: route.name
brief: 'The name of the route.'
stability: stable
requirement_level: required
type: string
- id: rate_limiter.type
brief: 'The type of rate limiter.'
stability: stable
requirement_level: required
type:
members:
- id: sliding
value: "SLIDING"
brief: 'SLIDING policy.'
stability: stable
- id: token
value: "TOKEN"
brief: 'TOKEN policy.'
stability: stable
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
imports:
- schema_url: https://opentelemetry.io/schemas/1.27.0
name: otel

groups:
- ref: otel:trace.http.server
brief: 'Trace reported by ACME HTTP Server library.'
attributes:
# The `requirement_level` of the following attributes is promoted to `required`
# Note: These 3 attributes are already attached to `trace.http.server`
- ref: otel:http.request.method
requirement_level: required
- ref: otel:client.address
requirement_level: required
- ref: otel:client.port
requirement_level: required
# A standard OTEL attribute is attached to the `trace.http.server`
# This attribute is not part of the OTEL definition of a `trace.http.server`
- ref: otel:thread.id
requirement_level: required
# Two locally defined attributes (see the attribute registry)
- ref: route.name
- ref: rate_limiter.type
29 changes: 29 additions & 0 deletions docs/specs/multi-registry/registries/app/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
imports:
- schema_url: https://opentelemetry.io/schemas/1.27.0
name: otel
- schema_url: https://github.com/acme-http-server-lib/schema_v0.7.1.yaml
name: acme

groups:
- id: endpoint.error
type: event
name: endpoint.error
brief: "An endpoint error event."
stability: stable
attributes:
- ref: otel:user.roles
requirement_level: required
- ref: otel:client.address
requirement_level: required
- ref: otel:client.port
requirement_level: required
- ref: otel:http.request.method
requirement_level: required
- ref: otel:error.type
requirement_level: required
- ref: otel:thread.id
requirement_level: required
- ref: acme:route.name
- ref: tenant.id


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
groups:
- id: registry.app
type: attribute_group
display_name: Enterprise Application Attributes
brief: 'A set of enterprise application attributes.'
attributes:
- id: tenant.id
brief: 'The customer tenant id.'
stability: stable
requirement_level: required
type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
groups:
- id: registry.waf
type: attribute_group
display_name: WAF Attributes
brief: 'A set of specific WAF attributes.'
attributes:
- id: waf.signature
brief: "The WAF signature"
type: string
- id: waf.action.type
brief: "The WAF action type."
stability: stable
type:
members:
- id: alarmed
value: "ALARMED"
brief: 'ALARMED action.'
stability: stable
- id: blocked
value: "BLOCKED"
brief: 'BLOCKED action.'
stability: stable
- id: legal
value: "LEGAL"
brief: 'LEGAL action.'
stability: stable
- id: dropped
value: "DROPPED"
brief: 'DROPPED action.'
stability: stable
30 changes: 30 additions & 0 deletions docs/specs/multi-registry/registries/waf-vendor/trace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# New optional section to define external registries to import in the current registry.
# Note: Unused imports will be detected by Weaver and reported as warnings by default.
imports:
# Importing an external registry involves specifying the schema URL associated with that registry.
# The current schema file structure needs to be updated, either by adding a reference to a
# self-contained and fully resolved semantic convention or by directly integrating its content into the schema.
# This approach is also well aligned with the OpenTelemetry Protocol specification,
# which already specifies a schema URL at the resource and scope levels.
- schema_url: https://opentelemetry.io/schemas/1.27.0
# A short and local name used to reference signals and attributes from the imported registry.
name: otel

groups:
# The following declaration overrides the definition of the `otel:trace.http.server` span group and changes
# the requirement level of few attributes to `required`.
# This override does not affect the original definition in the imported registry.
# Note: Similar to attribute references, group references cannot change the group type.
- ref: otel:trace.http.server
attributes:
# References to attributes from the imported registry must always be prefixed with the imported name and a colon.
# Local references do not require any prefix.
- ref: otel:http.request.method
requirement_level: required
- ref: otel:client.address
requirement_level: required
- ref: otel:client.port
requirement_level: required
# Locally defined attributes can be added to the imported group.
- ref: waf.action.type
requirement_level: required
36 changes: 36 additions & 0 deletions docs/specs/multi-registry/registries/waf-vendor/waf_action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# New optional section to define external registries to import in the current registry.
# Note: Unused imports will be detected by Weaver and reported as warnings by default.
imports:
# Importing an external registry involves specifying the schema URL associated with that registry.
# The current schema file structure needs to be updated, either by adding a reference to a
# self-contained and fully resolved semantic convention or by directly integrating its content into the schema.
# This approach is also well aligned with the OpenTelemetry Protocol specification,
# which already specifies a schema URL at the resource and scope levels.
- schema_url: https://opentelemetry.io/schemas/1.27.0
# A short and local name used to reference signals and attributes from the imported registry.
# We use `my_otel` here just to show that it can be any name and that different aliases can be used for the same
# schema URL across different semconv files in the same registry.
name: my_otel

groups:
# Locally defined metric group can both extend a locally defined attribute group and
# reference imported individual attributes.
- id: metric.waf.action.hit.count
type: metric
metric_name: waf.action.hit.count
brief: "The number of times the action was hit."
instrument: counter
unit: "{count}"
stability: stable
extends: registry.waf
attributes:
- ref: my_otel:http.request.method
requirement_level: required
- ref: my_otel:client.address
requirement_level: required
- ref: my_otel:client.port
requirement_level: required
- ref: waf.signature
requirement_level: required
- ref: waf.action.type
requirement_level: required
Loading