Skip to content

Commit

Permalink
make agentless spans and eval metrics endpoints constants
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrenner committed Sep 19, 2024
1 parent 4a85292 commit ce7e950
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/dd-trace/src/llmobs/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module.exports = {
EVP_PROXY_AGENT_ENDPOINT: 'evp_proxy/v2/api/v2/llmobs',
EVP_SUBDOMAIN_HEADER_NAME: 'X-Datadog-EVP-Subdomain',
EVP_SUBDOMAIN_HEADER_VALUE: 'llmobs-intake',
AGENTLESS_SPANS_ENDPOINT: '/api/v2/llmobs',
AGENTLESS_EVALULATIONS_ENDPOINT: '/api/intake/llm-obs/v1/eval-metric',

EVP_PAYLOAD_SIZE_LIMIT: 5 << 20, // 5MB (actual limit is 5.1MB)
EVP_EVENT_SIZE_LIMIT: (1 << 20) - 1024, // 999KB (actual limit is 1MB)
Expand Down
3 changes: 2 additions & 1 deletion packages/dd-trace/src/llmobs/writers/evaluations.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
'use strict'

const { AGENTLESS_EVALULATIONS_ENDPOINT } = require('../constants')
const BaseWriter = require('./base')

class LLMObsEvalMetricsWriter extends BaseWriter {
constructor (config) {
super({
endpoint: '/api/intake/llm-obs/v1/eval-metric',
endpoint: AGENTLESS_EVALULATIONS_ENDPOINT,
intake: `api.${config.site}`,
eventType: 'evaluation_metric'
})
Expand Down
3 changes: 2 additions & 1 deletion packages/dd-trace/src/llmobs/writers/spans/agentless.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
'use strict'

const { AGENTLESS_SPANS_ENDPOINT } = require('../../constants')
const LLMObsBaseSpanWriter = require('./base')

class LLMObsAgentlessSpanWriter extends LLMObsBaseSpanWriter {
constructor (config) {
super({
intake: `llmobs-intake.${config.site}`,
endpoint: '/api/v2/llmobs'
endpoint: AGENTLESS_SPANS_ENDPOINT
})

this._headers['DD-API-KEY'] = config.llmobs?.apiKey || config.apiKey
Expand Down

0 comments on commit ce7e950

Please sign in to comment.