Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Support comparing release versions without build code. ([#5376](https://github.com/getsentry/relay/pull/5376))
- Support uploading attachments directly to objectstore. ([#5367](https://github.com/getsentry/relay/pull/5367))
- Add `event.name` attribute to OTLP logs. ([#5396](https://github.com/getsentry/relay/pull/5396))

**Internal**:

Expand Down Expand Up @@ -53,7 +54,6 @@
- Remove the span kind from the Kafka span schema. ([#5368](https://github.com/getsentry/relay/pull/5368))
- Unconditionally enable span extraction. ([#5308](https://github.com/getsentry/relay/pull/5308))


## 25.10.0

**Features**:
Expand Down
1 change: 1 addition & 0 deletions relay-conventions/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ convention_attributes!(
DSC_TRACE_ID => "sentry.dsc.trace_id",
DSC_TRANSACTION => "sentry.dsc.transaction",
ENVIRONMENT => "sentry.environment",
EVENT_NAME => "event.name",
FAAS_TRIGGER => "faas.trigger",
GEN_AI_COST_INPUT_TOKENS => "gen_ai.cost.input_tokens",
GEN_AI_COST_OUTPUT_TOKENS => "gen_ai.cost.output_tokens",
Expand Down
4 changes: 3 additions & 1 deletion relay-ourlogs/src/otel_to_sentry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use chrono::{TimeZone, Utc};
use opentelemetry_proto::tonic::common::v1::InstrumentationScope;
use opentelemetry_proto::tonic::common::v1::any_value::Value as OtelValue;
use opentelemetry_proto::tonic::logs::v1::LogRecord as OtelLogRecord;
use relay_conventions::ORIGIN;
use relay_conventions::{EVENT_NAME, ORIGIN};

use opentelemetry_proto::tonic::resource::v1::Resource;
use relay_event_schema::protocol::{Attributes, OurLog, OurLogLevel, SpanId, Timestamp, TraceId};
Expand Down Expand Up @@ -59,6 +59,7 @@ pub fn otel_to_sentry_log(
attributes,
trace_id,
span_id,
event_name,
..
Copy link
Member

Choose a reason for hiding this comment

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

Any other fields hidden in .. that why might want to transform? I personally like listing all the unused fields as foo: _ to highlight that we ignore them deliberately.

Copy link
Member Author

Choose a reason for hiding this comment

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

the other fields don't have any value, but it's a good point to write them out as unused. Changed in 7e8f349

} = otel_log;

Expand All @@ -76,6 +77,7 @@ pub fn otel_to_sentry_log(

let mut attribute_data = Attributes::default();
attribute_data.insert(ORIGIN, "auto.otlp.logs".to_owned());
attribute_data.insert(EVENT_NAME, event_name.to_owned());

relay_otel::otel_scope_into_attributes(&mut attribute_data, resource, scope);

Expand Down
Loading