Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

13.2 KB
Raw Blame
{
  "version": 5,
  "definition": {
    "name": "gen_ai.llm",
    "condition": {
      "attributes": [
        {
          "value": "model"
        },
        {
          "value": "llm.input_messages"
        }
      ],
      "resource": []
    },
    "enabled": true,
    "mappers": [
      {
        "name": "gen_ai.request.model",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "reranker.model_name",
              "context": "attribute",
              "operation": "copy",
              "priority": 70
            },
            {
              "key": "llm.model_name",
              "context": "attribute",
              "operation": "copy",
              "priority": 60
            },
            {
              "key": "llm.request.model",
              "context": "attribute",
              "operation": "copy",
              "priority": 50
            },
            {
              "key": "ai.model.id",
              "context": "attribute",
              "operation": "copy",
              "priority": 40
            },
            {
              "key": "langfuse.observation.model.name",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "embedding.model_name",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "model",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            },
            {
              "key": "gen_ai.response.model",
              "context": "attribute",
              "operation": "copy",
              "priority": 5
            }
          ]
        }
      },
      {
        "name": "gen_ai.response.model",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "llm.response.model",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "ai.response.model",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.provider.name",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "gen_ai.system",
              "context": "attribute",
              "operation": "copy",
              "priority": 50
            },
            {
              "key": "llm.vendor",
              "context": "attribute",
              "operation": "copy",
              "priority": 40
            },
            {
              "key": "llm.provider",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "llm.system",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "ai.model.provider",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.operation.name",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "langfuse.observation.type",
              "context": "attribute",
              "operation": "copy",
              "priority": 40
            },
            {
              "key": "openinference.span.kind",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "llm.request.type",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "traceloop.span.kind",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.usage.input_tokens",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "input_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 60
            },
            {
              "key": "gen_ai.usage.prompt_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 50
            },
            {
              "key": "llm.usage.prompt_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 40
            },
            {
              "key": "llm.token_count.prompt",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "ai.usage.inputTokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "ai.usage.promptTokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.usage.output_tokens",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "output_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 60
            },
            {
              "key": "gen_ai.usage.completion_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 50
            },
            {
              "key": "llm.usage.completion_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 40
            },
            {
              "key": "llm.token_count.completion",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "ai.usage.outputTokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "ai.usage.completionTokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.usage.cache_read.input_tokens",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "cache_read_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 60
            },
            {
              "key": "gen_ai.usage.input_tokens.cached",
              "context": "attribute",
              "operation": "copy",
              "priority": 50
            },
            {
              "key": "gen_ai.usage.prompt_token_details.cached_read_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 40
            },
            {
              "key": "gen_ai.usage.cache_read_input_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "llm.token_count.prompt_details.cache_read",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "ai.usage.cachedInputTokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.usage.cache_creation.input_tokens",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "cache_creation_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 40
            },
            {
              "key": "gen_ai.usage.cache_write.input_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "gen_ai.usage.cache_creation_input_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "llm.token_count.prompt_details.cache_write",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.usage.reasoning.output_tokens",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "gen_ai.usage.reasoning_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 40
            },
            {
              "key": "gen_ai.usage.completion_token_details.reasoning_tokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "llm.token_count.completion_details.reasoning",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "ai.usage.reasoningTokens",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.input.messages",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "langfuse.observation.input",
              "context": "attribute",
              "operation": "move",
              "priority": 40
            },
            {
              "key": "gen_ai.prompt",
              "context": "attribute",
              "operation": "move",
              "priority": 30
            },
            {
              "key": "ai.prompt.messages",
              "context": "attribute",
              "operation": "move",
              "priority": 20
            },
            {
              "key": "input.value",
              "context": "attribute",
              "operation": "move",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.output.messages",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "langfuse.observation.output",
              "context": "attribute",
              "operation": "move",
              "priority": 40
            },
            {
              "key": "gen_ai.completion",
              "context": "attribute",
              "operation": "move",
              "priority": 30
            },
            {
              "key": "ai.response.toolCalls",
              "context": "attribute",
              "operation": "move",
              "priority": 25
            },
            {
              "key": "ai.response.text",
              "context": "attribute",
              "operation": "move",
              "priority": 20
            },
            {
              "key": "output.value",
              "context": "attribute",
              "operation": "move",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.conversation.id",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "gen_ai.client.session_id",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "session.id",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "langfuse.session.id",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      },
      {
        "name": "gen_ai.response.finish_reasons",
        "fieldContext": "attribute",
        "config": {
          "sources": [
            {
              "key": "llm.finish_reason",
              "context": "attribute",
              "operation": "copy",
              "priority": 50
            },
            {
              "key": "llm.response.stop_reason",
              "context": "attribute",
              "operation": "copy",
              "priority": 40
            },
            {
              "key": "llm.response.finish_reason",
              "context": "attribute",
              "operation": "copy",
              "priority": 30
            },
            {
              "key": "gen_ai.response.finish_reason",
              "context": "attribute",
              "operation": "copy",
              "priority": 20
            },
            {
              "key": "ai.response.finishReason",
              "context": "attribute",
              "operation": "copy",
              "priority": 10
            }
          ]
        }
      }
    ]
  }
}