Skip to content

Commit

Permalink
Revert "feat(openai): add model tag for openai metrics for consiste…
Browse files Browse the repository at this point in the history
…ncy with openai saas integration [backport 2.11]" (#10573)

- [x] Reverts #10382
  • Loading branch information
erikayasuda authored Sep 9, 2024
1 parent d2c1d54 commit 6d603f8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 23 deletions.
4 changes: 1 addition & 3 deletions ddtrace/llmobs/_integrations/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,11 @@ def _logs_tags(cls, span: Span) -> str:

@classmethod
def _metrics_tags(cls, span: Span) -> List[str]:
model_name = span.get_tag("openai.request.model") or ""
tags = [
"version:%s" % (config.version or ""),
"env:%s" % (config.env or ""),
"service:%s" % (span.service or ""),
"openai.request.model:%s" % model_name,
"model:%s" % model_name,
"openai.request.model:%s" % (span.get_tag("openai.request.model") or ""),
"openai.request.endpoint:%s" % (span.get_tag("openai.request.endpoint") or ""),
"openai.request.method:%s" % (span.get_tag("openai.request.method") or ""),
"openai.organization.id:%s" % (span.get_tag("openai.organization.id") or ""),
Expand Down
4 changes: 0 additions & 4 deletions releasenotes/notes/openai-model-tag-2482b3d5b2905db9.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions tests/contrib/openai/test_openai_v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ def test_completion(
"env:",
"service:",
"openai.request.model:ada",
"model:ada",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -221,7 +220,6 @@ async def test_acompletion(
"env:",
"service:",
"openai.request.model:curie",
"model:curie",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -323,7 +321,6 @@ def test_global_tags(openai_vcr, ddtrace_config_openai, openai, mock_metrics, mo
"env:staging",
"version:1234",
"openai.request.model:ada",
"model:ada",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.name:datadog-4",
Expand Down Expand Up @@ -1288,7 +1285,6 @@ def test_completion_stream(openai, openai_vcr, mock_metrics, mock_tracer):
"env:",
"service:",
"openai.request.model:ada",
"model:ada",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -1329,7 +1325,6 @@ async def test_completion_async_stream(openai, openai_vcr, mock_metrics, mock_tr
"env:",
"service:",
"openai.request.model:ada",
"model:ada",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -1377,7 +1372,6 @@ def test_chat_completion_stream(openai, openai_vcr, mock_metrics, snapshot_trace
"env:",
"service:",
"openai.request.model:gpt-3.5-turbo",
"model:gpt-3.5-turbo",
"openai.request.endpoint:/v1/chat/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -1428,7 +1422,6 @@ async def test_chat_completion_async_stream(openai, openai_vcr, mock_metrics, sn
"env:",
"service:",
"openai.request.model:gpt-3.5-turbo",
"model:gpt-3.5-turbo",
"openai.request.endpoint:/v1/chat/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down
9 changes: 0 additions & 9 deletions tests/contrib/openai/test_openai_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def test_completion(
"env:",
"service:",
"openai.request.model:ada",
"model:ada",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -238,7 +237,6 @@ async def test_acompletion(
"env:",
"service:",
"openai.request.model:curie",
"model:curie",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -346,7 +344,6 @@ def test_global_tags(openai_vcr, ddtrace_config_openai, openai, mock_metrics, mo
"env:staging",
"version:1234",
"openai.request.model:ada",
"model:ada",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.name:datadog-4",
Expand Down Expand Up @@ -944,7 +941,6 @@ def test_completion_stream(openai, openai_vcr, mock_metrics, mock_tracer):
"env:",
"service:",
"openai.request.model:ada",
"model:ada",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -983,7 +979,6 @@ async def test_completion_async_stream(openai, openai_vcr, mock_metrics, mock_tr
"env:",
"service:",
"openai.request.model:ada",
"model:ada",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -1026,7 +1021,6 @@ def test_completion_stream_context_manager(openai, openai_vcr, mock_metrics, moc
"env:",
"service:",
"openai.request.model:ada",
"model:ada",
"openai.request.endpoint:/v1/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -1073,7 +1067,6 @@ def test_chat_completion_stream(openai, openai_vcr, mock_metrics, snapshot_trace
"env:",
"service:",
"openai.request.model:gpt-3.5-turbo",
"model:gpt-3.5-turbo",
"openai.request.endpoint:/v1/chat/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -1122,7 +1115,6 @@ async def test_chat_completion_async_stream(openai, openai_vcr, mock_metrics, sn
"env:",
"service:",
"openai.request.model:gpt-3.5-turbo",
"model:gpt-3.5-turbo",
"openai.request.endpoint:/v1/chat/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down Expand Up @@ -1178,7 +1170,6 @@ async def test_chat_completion_async_stream_context_manager(openai, openai_vcr,
"env:",
"service:",
"openai.request.model:gpt-3.5-turbo",
"model:gpt-3.5-turbo",
"openai.request.endpoint:/v1/chat/completions",
"openai.request.method:POST",
"openai.organization.id:",
Expand Down

0 comments on commit 6d603f8

Please sign in to comment.