newrelic-experimental / gha-new-relic-exporter

18 stars 14 forks source link

No way to correlate logs with workflow run id #10

Closed niksrc closed 1 year ago

niksrc commented 1 year ago

There is currently no attribute set to link logs to workflow run id. Here's a sample log line:

{
  "completed_at": "2023-11-08T17:44:09.000Z",
  "conclusion": "success",
  "entity.guid": "MzM3MzkyNnxFWFR8U0VSVklDRXw4MTk5Nzg2ODcwMTUwNTMzMDU4",
  "entity.guids": "MzM3MzkyNnxFWFR8U0VSVklDRXw4MTk5Nzg2ODcwMTUwNTMzMDU4",
  "entity.name": "niksrc/repo",
  "entity.type": "SERVICE",
  "github.resource.type": "span",
  "github.source": "github-exporter",
  "instrumentation.provider": "opentelemetry",
  "message": "Running tests",
  "name": "Run E2E tests",
  "newrelic.logPattern": "nr.DID_NOT_MATCH",
  "newrelic.source": "api.logs.otlp",
  "number": "25",
  "otel.library.name": "opentelemetry.sdk._logs._internal",
  "otel.library.version": "",
  "otelSpanID": "3ca46680134c448c",
  "otelTraceID": "b253fa693895cbaa6d7c582b3c007648",
  "otelTraceSampled": true,
  "service.name": "niksrc/repo",
  "severity.number": 9,
  "severity.text": "INFO",
  "span.id": "3ca46680134c448c",
  "started_at": "2023-11-08T17:31:32.000Z",
  "status": "completed",
  "time": "2023-11-08T17:44:08.997",
  "timestamp": 1699465448997,
  "trace.id": "b253fa693895cbaa6d7c582b3c007648",
  "w3c.flags": 1
}
dpacheconr commented 1 year ago

Do you mean you can't see logs in context for the entity generated by the exporter? Or Do you mean that at workflow, job or step level the attribute workflow_run_id is missing? If you referring to workflow_run_id missing from a step, I just updated the action to take that into account and add it as attribute

niksrc commented 1 year ago

I meant "At workflow, job or step level the attribute workflow_run_id is missing". Yeah, it works now. Thanks for the quick response 🎉