newrelic-experimental / gha-new-relic-exporter

14 stars 7 forks source link

Step Level Spans Not Being Exported to New Relic #22

Closed domatthew1854 closed 1 week ago

domatthew1854 commented 3 months ago

Hello, we're currently running into an issue where only Spans of workflows and jobs are being exported.

Looking at distributed tracing, we only see spans at the job and workflow level.

Job spans are also shown as in-process spans

Screen Shot 2024-04-11 at 6 35 26 AM

In the logs of the New Relic Data Exporter action, I can see here that we get the error

ERROR: Log file does not exist: {step name} from job {job name}

Could this be the issue?

Screen Shot 2024-04-11 at 6 39 50 AM
dpacheconr commented 3 months ago

Can you enable debug login as per https://github.com/newrelic-experimental/gha-new-relic-exporter?tab=readme-ov-file#troubleshooting

replicate the issue then send us the logs? and your yaml configuration?

the output you sent usually means that action is running against action that is still running, the logs are only available after the action finishes running

with the debug logs and the yaml configuration, we should be able to know if that is really the case or there is another issue

domatthew1854 commented 3 months ago

This is the configuration of our New Relic Exporter

name: New Relic Exporter

on:
  workflow_run:
    workflows:
      - '*'
      - '!Cancel Forked Workflow Run'
    types: [completed] # defaults to run on every completed workflow run event

env:
  GHA_TOKEN: ${{ secrets.GH_TOKEN }}
  NEW_RELIC_LICENSE_KEY: ${{ secrets.NR_LICENSE_KEY }}
  GHA_RUN_ID: ${{ github.event.workflow_run.id }}
  GHA_RUN_NAME: ${{ github.event.workflow_run.name }}
  GHA_DEBUG: true

jobs:
  new-relic-exporter:
    name: new-relic-exporter
    runs-on: ubuntu-latest
    if: ${{ always() }}
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: new-relic-exporter
        uses: newrelic-experimental/gha-new-relic-exporter@latest

We have a workflow called Cancel Forked Workflow Run which prevents workflows from being triggered/queued on forked repositories.

Here are the logs from a run

Running on DEBUG mode
Processing Workflow -> Main Workflow run id -> 8709706841
2024-04-16 17:11:00,818 DEBUG [urllib3.connectionpool] [connectionpool.py:[10](https://github.com/****/****/actions/runs/8709720001/job/23890043835#step:4:11)55] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - Starting new HTTPS connection (1): api.github.com:443
send: b'GET /repos/****/****/actions/runs/8709706841/logs HTTP/1.1\r\nHost: api.github.com\r\nUser-Agent: python-requests/2.31.0\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/vnd.github+json\r\nConnection: keep-alive\r\nAuthorization: *** 2022-[11](https://github.com/****/****/actions/runs/8709720001/job/23890043835#step:4:12)-28\r\n\r\n'
reply: 'HTTP/1.1 302 Found\r\n'
header: Server: GitHub.com
header: Date: Tue, 16 Apr 2024 17:11:01 GMT
header: Content-Type: text/html;charset=utf-8
header: Content-Length: 0
header: Location: https://pipelinesghubeus4.actions.githubusercontent.com/YStqmRnmCeIYyDIjVrp3exsADnGeRrc9rCi7zTSrbKt8sPXSRb/_apis/pipelines/1/runs/65846/signedlogcontent?urlExpires=2024-04-16T17%3A[12](https://github.com/****/****/actions/runs/8709720001/job/23890043835#step:4:13)%3A01.0406061Z&urlSigningMethod=HMACV1&urlSignature=XIvtQXoBvSdbzfeFnYeT0aREewYFu08W%2BBn5CCpRg9A%3D
header: x-github-api-version-selected: 2022-11-28
header: X-RateLimit-Limit: 5000
header: X-RateLimit-Remaining: 4974
header: X-RateLimit-Reset: 1713288617
header: X-RateLimit-Used: 26
header: X-RateLimit-Resource: core
header: Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
header: Access-Control-Allow-Origin: *
header: Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
header: X-Frame-Options: deny
header: X-Content-Type-Options: nosniff
header: X-XSS-Protection: 0
header: Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
header: Content-Security-Policy: default-src 'none'
header: Vary: Accept-Encoding, Accept, X-Requested-With
header: X-GitHub-Request-Id: 9041:25AA6A:E37423:E45E79:661EB124
2024-04-16 17:11:01,089 DEBUG [urllib3.connectionpool] [connectionpool.py:549] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - https://api.github.com:443 "GET /repos/****/****/actions/runs/8709706841/logs HTTP/1.1" 302 0
2024-04-16 17:11:01,090 DEBUG [urllib3.connectionpool] [connectionpool.py:1055] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - Starting new HTTPS connection (1): pipelinesghubeus4.actions.githubusercontent.com:443
send: b'GET /YStqmRnmCeIYyDIjVrp3exsADnGeRrc9rCi7zTSrbKt8sPXSRb/_apis/pipelines/1/runs/65846/signedlogcontent?urlExpires=2024-04-16T17%3A12%3A01.0406061Z&urlSigningMethod=HMACV1&urlSignature=XIvtQXoBvSdbzfeFnYeT0aREewYFu08W%2BBn5CCpRg9A%3D HTTP/1.1\r\nHost: pipelinesghubeus4.actions.githubusercontent.com\r\nUser-Agent: python-requests/2.31.0\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/vnd.github+json\r\nConnection: keep-alive\r\nX-GitHub-Api-Version: 2022-11-28\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
2024-04-16 17:11:01,745 DEBUG [urllib3.connectionpool] [connectionpool.py:549] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - https://pipelinesghubeus4.actions.githubusercontent.com:443 "GET /YStqmRnmCeIYyDIjVrp3exsADnGeRrc9rCi7zTSrbKt8sPXSRb/_apis/pipelines/1/runs/65846/signedlogcontent?urlExpires=2024-04-16T17%3A12%3A01.0406061Z&urlSigningMethod=HMACV1&urlSignature=XIvtQXoBvSdbzfeFnYeT0aREewYFu08W%2BBn5CCpRg9A%3D HTTP/1.1" 200 None
header: Content-Type: application/zip
header: Date: Tue, 16 Apr 2024 17:11:00 GMT
header: Server: Kestrel
header: Cache-Control: no-store,no-cache
header: Pragma: no-cache
header: Transfer-Encoding: chunked
header: Strict-Transport-Security: max-age=2592000
header: X-TFS-ProcessId: c717eb6b-6c1c-44f0-b127-cef564ab7fa4
header: ActivityId: 27[13](https://github.com/****/****/actions/runs/8709720001/job/23890043835#step:4:14)2ab7-eca7-44cc-a79b-d7f341438e51
header: X-TFS-Session: 27132ab7-eca7-44cc-a79b-d7f34[14](https://github.com/****/****/actions/runs/8709720001/job/23890043835#step:4:15)38e51
header: X-VSS-E2EID: 27132ab7-eca7-44cc-a79b-d7f341438e51
header: X-VSS-SenderDeploymentId: 6074703f-c195-632a-bd61-2[16](https://github.com/****/****/actions/runs/8709720001/job/23890043835#step:4:17)91fc86fa5
header: Content-Disposition: attachment; filename=logs_65846.zip; filename*=UTF-8''logs_65846.zip
Processing job -> Check / Set build conditions
Processing step -> Set up job from job Check / Set build conditions
ERROR: Log file does not exist: Check / Set build conditions/1_Set up job.txt
Finished processing step -> Set up job from job Check / Set build conditions
Processing step -> Initialize containers from job Check / Set build conditions
ERROR: Log file does not exist: Check / Set build conditions/2_Initialize containers.txt
Finished processing step -> Initialize containers from job Check / Set build conditions
Processing step -> Set step/job execution conditions from job Check / Set build conditions
ERROR: Log file does not exist: Check / Set build conditions/3_Set stepjob execution conditions.txt
Finished processing step -> Set step/job execution conditions from job Check / Set build conditions
Processing step -> Get container image tag from job Check / Set build conditions
ERROR: Log file does not exist: Check / Set build conditions/4_Get container image tag.txt
Finished processing step -> Get container image tag from job Check / Set build conditions
Processing step -> Print configuration variables from job Check / Set build conditions
ERROR: Log file does not exist: Check / Set build conditions/5_Print configuration variables.txt
Finished processing step -> Print configuration variables from job Check / Set build conditions
Processing step -> Branch Name Compliancy Check from job Check / Set build conditions
ERROR: Log file does not exist: Check / Set build conditions/6_Branch Name Compliancy Check.txt
Finished processing step -> Branch Name Compliancy Check from job Check / Set build conditions
Processing step -> Checkout Repository from job Check / Set build conditions
Log file not expected for this step -> Checkout Repository <- because its status is -> skipped
Finished processing step -> Checkout Repository from job Check / Set build conditions
Processing step -> Set dependencies from job Check / Set build conditions
Log file not expected for this step -> Set dependencies <- because its status is -> skipped
Finished processing step -> Set dependencies from job Check / Set build conditions
Processing step -> Check code quality from job Check / Set build conditions
Log file not expected for this step -> Check code quality <- because its status is -> skipped
Finished processing step -> Check code quality from job Check / Set build conditions
Processing step -> Check code quality - Failure Check from job Check / Set build conditions
Log file not expected for this step -> Check code quality - Failure Check <- because its status is -> skipped
Finished processing step -> Check code quality - Failure Check from job Check / Set build conditions
Processing step -> Get affected projects from job Check / Set build conditions
Log file not expected for this step -> Get affected projects <- because its status is -> skipped
Finished processing step -> Get affected projects from job Check / Set build conditions
Processing step -> Get affected projects - Failure Check from job Check / Set build conditions
Log file not expected for this step -> Get affected projects - Failure Check <- because its status is -> skipped
Finished processing step -> Get affected projects - Failure Check from job Check / Set build conditions
Processing step -> Stop containers from job Check / Set build conditions
ERROR: Log file does not exist: Check / Set build conditions/[24](https://github.com/****/****/actions/runs/8709720001/job/23890043835#step:4:25)_Stop containers.txt
Finished processing step -> Stop containers from job Check / Set build conditions
Processing step -> Complete job from job Check / Set build conditions
ERROR: Log file does not exist: Check / Set build conditions/[25](https://github.com/****/****/actions/runs/8709720001/job/23890043835#step:4:26)_Complete job.txt
Finished processing step -> Complete job from job Check / Set build conditions
Finished processing job -> Check / Set build conditions
Processing job -> Unit Test
Finished processing job -> Unit Test
Processing job -> Sonarqube scan
Finished processing job -> Sonarqube scan
Processing job -> Run end-to-end tests
Finished processing job -> Run end-to-end tests
Processing job -> Release applications to production
Finished processing job -> Release applications to production
Processing job -> Main Workflow Failure
Finished processing job -> Main Workflow Failure
Finished processing Workflow -> Main Workflow run id -> 8709706841
All data exported to New Relic
dpacheconr commented 2 months ago

@domatthew1854 it does look like it's running against action that is still running will need to see your full flow and configuration, not just the exporter configuration to be able to advise further happy to jump on session to discuss/diagnose this further message me on dpacheco@newrelic.com with your availability so we can arrange session

dpacheconr commented 1 week ago

no reply over 1.5 months