-
Couldn't load subscription status.
- Fork 1k
Add logstash structured arg support #14959
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
Conversation
|
🔧 The result from spotlessApply was committed to the PR branch. |
ab6b5f7 to
feda427
Compare
|
🔧 The result from spotlessApply was committed to the PR branch. |
1195199 to
9373335
Compare
|
🔧 The result from spotlessApply was committed to the PR branch. |
df8dd85 to
25815fa
Compare
|
🔧 The result from spotlessApply was committed to the PR branch. |
71f14a8 to
5d8517e
Compare
|
🔧 The result from spotlessApply was committed to the PR branch. |
|
🔧 The result from spotlessApply was committed to the PR branch. |
| | `otel.instrumentation.logback-appender.experimental.capture-logger-context-attributes` | Boolean | `false` | Enable the capture of Logback logger context properties as attributes. | | ||
| | `otel.instrumentation.logback-appender.experimental.capture-arguments` | Boolean | `false` | Enable the capture of Logback logger arguments. | | ||
| | `otel.instrumentation.logback-appender.experimental.capture-logstash-attributes` | Boolean | `false` | Enable the capture of Logstash attributes, supported are those added to logs via `Markers.append()`, `Markers.appendEntries()`, `Markers.appendArray()` and `Markers.appendRaw()` methods. | | ||
| | `otel.instrumentation.logback-appender.experimental.capture-logstash-marker-attributes` | Boolean | `false` | Enable the capture of Logstash markers, supported are those added to logs via `Markers.append()`, `Markers.appendEntries()`, `Markers.appendArray()` and `Markers.appendRaw()` methods. | |
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.
renamed capture-logstash-attributes to be more specific: capture-logstash-marker-attributes
to avoid confusion with the new capture-logstash-structured-arguments
f52feeb to
e8a2d89
Compare
| }, | ||
| { | ||
| "name": "otel.instrumentation.logback-appender.experimental.capture-logstash-attributes", | ||
| "name": "otel.instrumentation.logback-appender.experimental.capture-logstash-marker-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.
@zeitlinger is it ok to remove deprecated property right away here?
e8a2d89 to
23c2f6d
Compare
| * any time. | ||
| */ | ||
| @SuppressWarnings("unused") // keep around for next time even if not currently used | ||
| public final class DeprecatedConfigProperties { |
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.
modified version of class from javaagent-extension-api
|
🔧 The result from spotlessApply was committed to the PR branch. |
796011a to
b69a47d
Compare
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| public class LogstashMarkerTest { |
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.
these tests are just move here from Slf4j2Test.java
| .hasInstrumentationScope(instrumentationScopeInfo) | ||
| .hasBody("log message 1") | ||
| .hasTotalAttributeCount(codeAttributesLogCount())); | ||
| } |
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.
these tests are just moved to LogstachMarkerTest.java
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| public class LogstashStructuredArgsTest { |
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.
new tests for the new feature
| } | ||
| implementation("net.logstash.logback:logstash-logback-encoder") { | ||
| version { | ||
| strictly("6.6") |
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.
StructuredArguments was introduced after LogstashMarker which is why separate test suite here
|
🔧 The result from spotlessApply was committed to the PR branch. |
1b42518 to
4b770a0
Compare
| | `otel.instrumentation.logback-appender.experimental.capture-logger-context-attributes` | Boolean | `false` | Enable the capture of Logback logger context properties as attributes. | | ||
| | `otel.instrumentation.logback-appender.experimental.capture-arguments` | Boolean | `false` | Enable the capture of Logback logger arguments. | | ||
| | `otel.instrumentation.logback-appender.experimental.capture-logstash-attributes` | Boolean | `false` | Enable the capture of Logstash attributes, supported are those added to logs via `Markers.append()`, `Markers.appendEntries()`, `Markers.appendArray()` and `Markers.appendRaw()` methods. | | ||
| | `otel.instrumentation.logback-appender.experimental.capture-logstash-marker-attributes` | Boolean | `false` | Enable the capture of Logstash markers, supported are those added to logs via `Markers.append()`, `Markers.appendEntries()`, `Markers.appendArray()` and `Markers.appendRaw()` methods. | |
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 think this file needs a reformat
...rkerTest/java/io/opentelemetry/instrumentation/logback/appender/v1_0/LogstashMarkerTest.java
Outdated
Show resolved
Hide resolved
.../java/io/opentelemetry/instrumentation/logback/appender/v1_0/LogstashStructuredArgsTest.java
Outdated
Show resolved
Hide resolved
| | `captureLoggerContext` | Boolean | `false` | Enable the capture of Logback logger context properties as attributes. | | ||
| | `captureArguments` | Boolean | `false` | Enable the capture of Logback logger arguments. | | ||
| | `captureLogstashAttributes` | Boolean | `false` | Enable the capture of Logstash attributes, supported are those added to logs via `Markers.append()`, `Markers.appendEntries()`, `Markers.appendArray()` and `Markers.appendRaw()` methods. | | ||
| | `captureLogstashMarkerAttributes` | Boolean | `false` | Enable the capture of Logstash markers, supported are those added to logs via `Markers.append()`, `Markers.appendEntries()`, `Markers.appendArray()` and `Markers.appendRaw()` methods. | |
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 think this one also needs a reformat
…ashMarkerTest/java/io/opentelemetry/instrumentation/logback/appender/v1_0/LogstashMarkerTest.java Co-authored-by: Lauri Tulmin <[email protected]>
…ashStructuredArgsTest/java/io/opentelemetry/instrumentation/logback/appender/v1_0/LogstashStructuredArgsTest.java Co-authored-by: Lauri Tulmin <[email protected]>
7c49c5a to
aad7ecb
Compare
Adds support for capturing Logstash
StructuredArguments(e.g.,StructuredArguments.v()andStructuredArguments.keyValue()) as OpenTelemetry log record attributes.Key changes:
otel.instrumentation.logback-appender.experimental.capture-logstash-structured-arguments(defaults tofalse)capture-logstash-attributesconfig tocapture-logstash-marker-attributesfor clarity (with deprecation support)Resolves #14230