@@ -112,7 +112,7 @@ func ignoreLogs(ctx context.Context) bool {
112112 return ok
113113}
114114
115- // Use a processor which sets EventName on log records having "event.name" string attribute.
115+ // Use a processor which sets EventName on log records having "otel. event.name" string attribute.
116116// This is useful for users of logging libraries that do not support
117117// setting the event name on log records, but do support attributes.
118118func ExampleProcessor_eventName () {
@@ -132,17 +132,17 @@ func ExampleProcessor_eventName() {
132132}
133133
134134// EventNameProcessor is a [log.Processor] that sets the EventName
135- // on log records having "event.name" string attribute.
135+ // on log records having "otel. event.name" string attribute.
136136// It is useful for logging libraries that do not support
137137// setting the event name on log records,
138138// but do support attributes.
139139type EventNameProcessor struct {}
140140
141- // OnEmit sets the EventName on log records having an "event.name" string attribute.
141+ // OnEmit sets the EventName on log records having an "otel. event.name" string attribute.
142142// The original attribute is not removed.
143143func (* EventNameProcessor ) OnEmit (_ context.Context , record * log.Record ) error {
144144 record .WalkAttributes (func (kv logapi.KeyValue ) bool {
145- if kv .Key == "event.name" && kv .Value .Kind () == logapi .KindString {
145+ if kv .Key == "otel. event.name" && kv .Value .Kind () == logapi .KindString {
146146 record .SetEventName (kv .Value .AsString ())
147147 }
148148 return true
0 commit comments