dgryski.semgrep-go.nrtxn.newrelic-start-without-end

profile photo of dgryskidgryski
Author
581
Download Count*
License

missing new relic end transaction

Run Locally

Run in CI

Defintion

rules:
  - id: newrelic-start-without-end
    patterns:
      - pattern-not-inside: |
          $TXN := $NR.StartTransaction($N)
          ...
          defer $TXN.End()
      - pattern-not-inside: |
          $TXN := $NR.StartTransaction($N)
          ...
          $TXN.End()
      - pattern-either:
          - pattern: $TXN := $NR.StartTransaction($N)
    message: missing new relic end transaction
    languages:
      - go
    severity: ERROR
    metadata:
      license: MIT