Fix WithSpanHandler: remove hardcode, add constants instead#1927
Fix WithSpanHandler: remove hardcode, add constants instead#1927mdomansky wants to merge 4 commits intoopen-telemetry:mainfrom
Conversation
ChrisLightfootWild
left a comment
There was a problem hiding this comment.
This is intentionally hardcoded to avoid the dependency on SemConv in the API package.
Why do I get the issue like |
I believe Might be worth asking the otel collector devs on this one. The schema file links to open-telemetry/semantic-conventions#1624 from the ...trimmed
1.30.0:
all:
changes:
...trimmed
- rename_attributes:
attribute_map:
code.function: code.function.name
code.filepath: code.file.path
code.lineno: code.line.number
code.column: code.column.numberMy understanding is that we are emitting valid telemetry for the schema version we have declared, and that the collector should rename the attributes during ingestion. |
|
@open-telemetry/collector-approvers, can you weigh in here? |
|
The error on this PR's description seems specific to the opensearch exporter, feel free to file an issue on the opentelemetry-collector-contrib bug tracker and the code owners will take a look |
|
Updated the schema version and updated span attribute names according to the scheme. Left hardcoded attribute names. |
Co-authored-by: Tobias Bachert <github.dev.k9ps1@mail.tobiasbachert.com>
| ->setAttribute('code.function.name', $class !== null ? $class . '::' . $function : $function) | ||
| ->setAttribute('code.file.path', $filename) | ||
| ->setAttribute('code.line.number', $lineno) | ||
| ->setAttribute('code.column.number', $lineno) |
There was a problem hiding this comment.
This doesn't look right. I don't think we should use the line number as column number.
I have a list of containers:
1 - my php app
2 - otel-collector
3 - opensearch
While using
#[WithSpan]attribute on methods on myphpcontainer, all span information is successfully sent to theotel-collectorcontainer, but while the last sends the info to theopensearchdatabase I get an exception:My env:
Having researched, I found that "wrong" attribute names are hardcoded, so I updated them with constants.