Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence attributes should be homogeneous but we allow booleans and integers in the same sequence #2045

Closed
owais opened this issue Aug 17, 2021 · 0 comments · Fixed by #2044
Labels
bug Something isn't working

Comments

@owais
Copy link
Contributor

owais commented Aug 17, 2021

Steps to reproduce

from opentelemetry import trace
from opentelemetry.sdk.trace import Resource, TracerProvider, SpanLimits
from opentelemetry.sdk.trace.export import (
    SimpleSpanProcessor,
    ConsoleSpanExporter,
)

provider = TracerProvider()
processor = SimpleSpanProcessor(ConsoleSpanExporter())
provider.add_span_processor(processor)
trace.set_tracer_provider(provider)


tracer = trace.get_tracer(__name__)


with tracer.start_as_current_span("s1", attributes={"k": [1, True]}):
    pass

What is the expected behavior?

❯ python main.py
Mixed types int and bool in attribute value sequence
{
    "name": "s1",
    "context": {
        "trace_id": "0xf38bc0cff3b8d48ac7ca25d7f907c045",
        "span_id": "0xc220c0bb6ad3b802",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": null,
    "start_time": "2021-08-17T09:32:11.894501Z",
    "end_time": "2021-08-17T09:32:11.894567Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {},
    "events": [],
    "links": [],
    "resource": {
        "telemetry.sdk.language": "python",
        "telemetry.sdk.name": "opentelemetry",
        "telemetry.sdk.version": "1.4.1",
        "service.name": "unknown_service"
    }
}

What is the actual behavior?

❯ python main.py
{
    "name": "s1",
    "context": {
        "trace_id": "0xe46df9563d1c390fb8b6d8fb7e49036d",
        "span_id": "0x32a92ead98330ec7",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": null,
    "start_time": "2021-08-17T09:30:54.912310Z",
    "end_time": "2021-08-17T09:30:54.912332Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {
        "k": [
            1,
            true
        ]
    },
    "events": [],
    "links": [],
    "resource": {
        "telemetry.sdk.language": "python",
        "telemetry.sdk.name": "opentelemetry",
        "telemetry.sdk.version": "1.4.1",
        "service.name": "unknown_service"
    }
}
@owais owais added the bug Something isn't working label Aug 17, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Aug 17, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Aug 17, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Aug 17, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Aug 17, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Aug 17, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Aug 17, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Aug 17, 2021
owais added a commit that referenced this issue Aug 19, 2021
owais added a commit that referenced this issue Aug 24, 2021
* Added support for `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`

Fixes #2045
Fixes #2043
Fixes #2042
Fixes #2041

* SpanLimit: Treat empty value env vars as unset

Fixes #2052

* Update CHANGELOG.md

Co-authored-by: Leighton Chen <[email protected]>

Co-authored-by: Leighton Chen <[email protected]>
owais added a commit that referenced this issue Aug 24, 2021
* Added support for `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`

Fixes #2045
Fixes #2043
Fixes #2042
Fixes #2041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant