-
Notifications
You must be signed in to change notification settings - Fork 105
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
Sem con 1.27.0 #733
Sem con 1.27.0 #733
Conversation
Should this be a draft PR and we not merge it until I can send you a patch with the Erlang update so they stay in sync? |
Yeah. You can move it to draft and work on this branch directly. I won't modify anything while you work. |
I'm open to feedback and discussion on namespacing and multiple files (semantic attributes and semantic resource attributes). It doesn't appear there's anything consistent being employed, so there's nothing prescriptive to guide or bind us.
|
@bryannaegele can you add to the readme how to run generate.ex |
So JS has no metrics? And Python is still on 1.21. |
Looks like python moving to a file per https://github.com/open-telemetry/opentelemetry-python/pull/3586/files |
Since starting this 1.26.0 has been released along with the new weaver generator. Part of 1.26.0 was the finalization of the An important change that needs to be addressed for Erlang is I was able to get the reference guides added pretty easily now, as well. Linking into them from the modules isn't working but they're there, making it unnecessary to go to the website now. One outstanding issue is on function naming. Right now the default formatting creates functions with the ctx id's name prefixed, e.g. |
apps/opentelemetry_semantic_conventions/lib/container_attributes.ex
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish the package didn't use atoms since there is no way to do dead-code elimination and they are limited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor suggestions, but looks great - thanks a lot for doing this :)
- pattern: semantic_attributes.ex.j2 | ||
filter: > | ||
.groups | ||
| map(select(.type == "attribute_group")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you should be able to use some new helpers are remove most of this code https://github.com/open-telemetry/weaver/blob/2e74ab36e6bd6599bd9231b83e9002e40f199712/crates/weaver_forge/README.md?plain=1#L375
here's an example of how it's now done in python https://github.com/open-telemetry/opentelemetry-python/blob/main/scripts/semconv/templates/registry/weaver.yaml
.groups | ||
| map(select(.type == "metric")) | ||
| map(select(.stability == $stability)) | ||
| map({ id: .id, group_id: .id | split(".") | .[1], brief, unit, stability, deprecated, instrument, metric_name, note}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a small bug in this snippet and in the new helper method - open-telemetry/weaver#289, it's not a problem for 1.26.0, but there will be a tiny issue issue with 1.27.0 - workaround is shared in that issue, but we plan to fix it in weaver in the next release
apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2
Show resolved
Hide resolved
### Erlang | ||
|
||
```erlang | ||
?{{ metric.metric_name | snake_case | upper }}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
?{{ metric.metric_name | snake_case | upper }}. | |
?{{ metric.metric_name | screaming_snake_case }}. |
{% endif -%} | ||
{% endfor %} | ||
{% endif -%} | ||
{%- for attribute in ctx.attributes | sort(attribute="name") %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: attributes are already sorted
{%- for attribute in ctx.attributes | sort(attribute="name") %} | |
{%- for attribute in ctx.attributes %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried this again and it's still outputting descending instead of ascending without the additional sort. Not sure where it's happening but I've got to leave it in for now. Same for metrics
apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2
Show resolved
Hide resolved
Is there a point at which we remove old ones? Is that determined by the WG or some other way? |
Ok. We're all the way to 1.27.0 now and the http libs are ready to go for beta. There are some weaver updates that can still be done but it's not necessary to get this out. @tsloughter take a look at this list of excludes before publishing. We can always add something in later if needed.
https://github.com/open-telemetry/semantic-conventions/tree/v1.27.0/model |
@bryannaegele excludes are semconv we don't care about, right? I'll have to look closer but first thought is that "cicd" we might want. |
And why would we leave out ones like cpu, device, disk, linux, system? I get they are low level but still might want to report some of that from an Erlang application. Similar for |
For CICD were you thinking of somebody tracing in tests? |
@bryannaegele right. |
Ok. I limited the excludes to just language/OS/runtime type namespaces, i.e. ios, jvm, v8, dotnet, etc Also added a step to remove any guides matching those namespaces, as well. @tsloughter I think that should wrap it up if you want to do one last spot-check of some attrs, docs, and metrics |
With the new layout everything common has been extracted out by the wg to a registry. From that, there's the
attribute_group
model which I chose to just namecommon
instead.trace
moved tospan
now which I guess makes sense but I could go either way with overriding that name.Everything is a breaking change, so we have some freedom here. I attempted the single file approach Java did but the docs just get really confusing about what's common, trace-specific, and metric-specific.
Erlang is not done. I think once the hrl template is fixed up and verify we have everything being generated in the right namespaces, we can get it out there and continue to refine the docs and add guides. That should unblock all the http, bandit, phoenix work to be done.
I also switched from the shell script to an elixir script (
elixir generate.exs
) to parallelize the builds.