• EnglishEspañol日本語한국어Português
  • EntrarComeçar agora

Esta tradução de máquina é fornecida para sua comodidade.

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

Criar um problema

current_trace_id (API do agente Python)

Sintaxe

newrelic.agent.current_trace_id()

Retorna o ID trace da transação atual ou None se não existir nenhuma transação.

Descrição

Use current_trace_id para recuperar o ID trace da transação atual.

Valores de retorno

Retorna o trace ID da transação atual. Retornará None se não houver nenhuma transação ativa.

Exemplos

Obtenha o ID trace atual

import newrelic.agent
@newrelic.agent.background_task()
def main():
trace_id = newrelic.agent.current_trace_id()
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.