Skip to content
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

Add log exporter test method #15

Merged
merged 6 commits into from
Aug 28, 2024
Merged

Add log exporter test method #15

merged 6 commits into from
Aug 28, 2024

Conversation

cyrille-leclerc
Copy link
Contributor

@cyrille-leclerc cyrille-leclerc commented Aug 8, 2024

Add log exporter test method to enable testing the connectivity of OTel SDKs instantiated on Jenkins build agents.

On the Jenkins build agent screen in Jenkins, navigate to the Script console screen and execute the command

io.jenkins.plugins.opentelemetry.api.util.OpenTelemetryUtils.testLogRecordExporter()

The result looks like

Result: testLogRecordExporter(): result(success: truedone: true), OtlpGrpcLogRecordExporter{exporterName=otlp, type=log, endpoint=http://localhost:4317, endpointPath=/opentelemetry.proto.collector.logs.v1.LogsService/Export, timeoutNanos=30000000000, connectTimeoutNanos=10000000000, compressorEncoding=null, headers=Headers{User-Agent=OBFUSCATED}, memoryMode=IMMUTABLE_DATA}, TestLogRecordData{resource=Resource{schemaUrl=null, attributes={host.arch="aarch64", host.name="cyrille-le-clerc-macbook.local", jenkins.computer.name="jnlp_agent", jenkins.opentelemetry.plugin.version="3.999999-SNAPSHOT (private-830d1fd1-cyrilleleclerc)", jenkins.url="http://localhost:8080/jenkins/", jenkins.version="2.440.3", os.description="Mac OS X 14.6.1", os.type="darwin", process.command_line="/opt/homebrew/Cellar/openjdk@11/11.0.24/libexec/openjdk.jdk/Contents/Home/bin/java --add-opens=java.base/java.io=ALL-UNNAMED agent.jar -url http://localhost:8080/jenkins/ -secret e4fd75fdd833e03df45f85d2084e2898b09b03a29a59349dcfd7d6c66e849824 -name jnlp_agent -workDir ~/jenkins/agent-intellij", process.executable.path="/opt/homebrew/Cellar/openjdk@11/11.0.24/libexec/openjdk.jdk/Contents/Home/bin/java", process.pid=34012, process.runtime.description="Homebrew OpenJDK 64-Bit Server VM 11.0.24+0", process.runtime.name="OpenJDK Runtime Environment", process.runtime.version="11.0.24+0", service.instance.id="1adfda6bdc8e8b6dd676433c55b1386f", service.name="jenkins", service.namespace="jenkins", service.version="2.440.3", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.40.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=io.jenkins.opentelemetry.api, version=null, schemaUrl=null, attributes={}}, timestampEpochNanos=1724792031745884000, observedTimestampEpochNanos=0, spanContext=ImmutableSpanContext{traceId=00000000000000000000000000000000, spanId=0000000000000000, traceFlags=00, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}, severity=INFO, severityText=INFO, body=StringBody{asString=Test log record}, attributes={}, totalAttributeCount=0} -
image

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

# Conflicts:
#	src/main/java/io/jenkins/plugins/opentelemetry/api/ReconfigurableOpenTelemetry.java
@cyrille-leclerc cyrille-leclerc marked this pull request as ready for review August 27, 2024 20:54
@cyrille-leclerc cyrille-leclerc requested a review from a team as a code owner August 27, 2024 20:54
@cyrille-leclerc cyrille-leclerc added the enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Aug 27, 2024
@cyrille-leclerc cyrille-leclerc merged commit 65c5907 into main Aug 28, 2024
17 checks passed
@cyrille-leclerc cyrille-leclerc deleted the log-exporter-test branch August 28, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants