agentmark-sdk 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/CHANGELOG.md +21 -0
  2. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/PKG-INFO +1 -1
  3. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/pyproject.toml +1 -1
  4. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/config.py +1 -1
  5. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/otlp_json_exporter.py +8 -0
  6. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/.gitignore +0 -0
  7. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/package.json +0 -0
  8. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/__init__.py +0 -0
  9. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/decorator.py +0 -0
  10. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/masking_processor.py +0 -0
  11. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/pii_masker.py +0 -0
  12. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/py.typed +0 -0
  13. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/sampler.py +0 -0
  14. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/sdk.py +0 -0
  15. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/serialize.py +0 -0
  16. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/src/agentmark_sdk/trace.py +0 -0
  17. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/tests/__init__.py +0 -0
  18. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/tests/test_decorator.py +0 -0
  19. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/tests/test_masking_processor.py +0 -0
  20. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/tests/test_otlp_json_exporter.py +0 -0
  21. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/tests/test_pii_masker.py +0 -0
  22. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/tests/test_sampler.py +0 -0
  23. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/tests/test_sdk.py +0 -0
  24. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/tests/test_serialize.py +0 -0
  25. {agentmark_sdk-0.2.0 → agentmark_sdk-0.2.1}/tests/test_trace.py +0 -0
@@ -1,3 +1,24 @@
1
+ ## 0.2.1 (2026-04-16)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - fix: set explicit User-Agent on OTLP span exports to bypass Cloudflare BIC ([#584](https://github.com/agentmark-ai/agentmark/pull/584))
6
+
7
+ Cloudflare's Browser Integrity Check rejects requests bearing the default
8
+ `Python-urllib/*` User-Agent with HTTP 403 (error code 1010). `JsonOtlpSpanExporter`
9
+ uses `urllib.request.urlopen` without setting a UA, so every trace export through
10
+ a Cloudflare-proxied zone (api.agentmark.co, api-stg.agentmark.co) was silently
11
+ rejected before reaching the gateway. Combined with the exporter's bare
12
+ `except Exception: return FAILURE`, the failure produced no logs, no metrics,
13
+ and no ClickHouse rows — just a complete absence of traces.
14
+
15
+ The `ApiLoader` path (`/v1/templates` etc.) wasn't affected because it uses
16
+ `httpx`, whose default UA `python-httpx/<version>` isn't on the BIC block list.
17
+
18
+ Set `User-Agent: agentmark-sdk-python/<version>` on every outbound POST. The
19
+ version is resolved at import time via `importlib.metadata.version("agentmark-sdk")`
20
+ so it stays in lockstep with the installed distribution.
21
+
1
22
  ## 0.2.0 (2026-04-13)
2
23
 
3
24
  ### 🚀 Features
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentmark-sdk
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: AgentMark SDK for Python - Tracing and Observability
5
5
  Author-email: AgentMark <support@agentmark.co>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentmark-sdk"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "AgentMark SDK for Python - Tracing and Observability"
5
5
  requires-python = ">=3.10"
6
6
  keywords = [
@@ -2,7 +2,7 @@
2
2
 
3
3
  # API Endpoints
4
4
  AGENTMARK_TRACE_ENDPOINT = "v1/traces"
5
- AGENTMARK_SCORE_ENDPOINT = "v1/score"
5
+ AGENTMARK_SCORE_ENDPOINT = "v1/scores"
6
6
 
7
7
  # Default base URL
8
8
  DEFAULT_BASE_URL = "https://api.agentmark.co"
@@ -15,12 +15,19 @@ import base64
15
15
  import json
16
16
  import urllib.request
17
17
  from collections import defaultdict
18
+ from importlib.metadata import version as _pkg_version
18
19
  from typing import Any, Sequence
19
20
 
20
21
  from opentelemetry.sdk.trace import ReadableSpan
21
22
  from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
22
23
  from opentelemetry.trace import SpanKind
23
24
 
25
+ # Cloudflare Browser Integrity Check rejects the default urllib User-Agent
26
+ # ("Python-urllib/x.y") with a 403 error code 1010. Set an explicit SDK UA so
27
+ # requests through proxied zones (api.agentmark.co et al) aren't blocked
28
+ # before reaching the gateway.
29
+ _SDK_USER_AGENT = f"agentmark-sdk-python/{_pkg_version('agentmark-sdk')}"
30
+
24
31
  # OTLP wire format uses 1-indexed SpanKind values (UNSPECIFIED=0,
25
32
  # INTERNAL=1, SERVER=2, ...) while the Python API uses 0-indexed
26
33
  # (INTERNAL=0, SERVER=1, ...). This mapping is stable per the OTLP spec.
@@ -50,6 +57,7 @@ class JsonOtlpSpanExporter(SpanExporter):
50
57
  data=payload,
51
58
  headers={
52
59
  "Content-Type": "application/json",
60
+ "User-Agent": _SDK_USER_AGENT,
53
61
  **self._headers,
54
62
  },
55
63
  method="POST",
File without changes