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

Support for "map" conventions based on prefixes #29

Closed
Oberon00 opened this issue Feb 22, 2021 · 2 comments
Closed

Support for "map" conventions based on prefixes #29

Oberon00 opened this issue Feb 22, 2021 · 2 comments
Labels
semconv/model Related to the data model or YAML format of the semantic convention generator semconv Related to the semantic convention generator.

Comments

@Oberon00
Copy link
Member

Oberon00 commented Feb 22, 2021

See this suggested semantic convention for HTTP headers: open-telemetry/opentelemetry-specification#1061.

Right now, I think it is not possible to specify this in the semantic convention generator. It would be useful however to generate a constant for the http.request.header prefix (or http.request.header. with a trailing dot, or a function string httpRequestHeaderName(string key) { return 'http.request.header' + key; }.

In the markdown, this should probably be designated by adding .* to the name of the attribute. E.g. like this:

Attribute Type Description Examples Required
http.request.header.<key> string[] HTTP request headers, <key> being the HTTP Header name (case preserving), the value being the header values. http.request.header.Content-Type=["application/json"]; http.request.X-Forwarded-for=["1.2.3.4", "1.2.3.5"] No

In the YAML source:

  • The type could be specified like type: prefix_map: string[].
  • Examples need to be handled specially here, as they need to include both the key (suffix) and a value.
@Oberon00
Copy link
Member Author

Caveat: We should not implement this before discussing over in the spec repo if that prefix-based scheme is something we may want to use more often.

@Oberon00 Oberon00 added semconv Related to the semantic convention generator. semconv/model Related to the data model or YAML format of the semantic convention generator labels Apr 7, 2021
@lmolkova
Copy link
Contributor

I believe it's fixed in the #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semconv/model Related to the data model or YAML format of the semantic convention generator semconv Related to the semantic convention generator.
Projects
None yet
Development

No branches or pull requests

2 participants