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

Add scope (if exists) to exported logs #20659

Closed
tamir-michaeli opened this issue Apr 4, 2023 · 6 comments
Closed

Add scope (if exists) to exported logs #20659

tamir-michaeli opened this issue Apr 4, 2023 · 6 comments

Comments

@tamir-michaeli
Copy link
Contributor

Component(s)

exporter/logzio

Is your feature request related to a problem? Please describe.

When using OpentelemetryAppender for log4j2 with the collector, originating class and package are missing from the logs.
Example when log exported to a file (using fileexporter):

"scopeLogs":
[
    {
        "scope":
        {
            "name": "my.package.MyClass"
        },
        "logRecords":
        [
            {
                "timeUnixNano": "1679392848655807000",
                "severityNumber": 5,
                "severityText": "DEBUG",
                "body":
                {
                    "stringValue": "nice logging message"
                },
                "flags": 1,
                "traceId": "6a902c1bdbf3761f3584f0e54ca4592f",
                "spanId": "ec2349124b1d1449"
            }
        ]
    }
]

When the log is exported using logzioexporter, the scope copied into the log.

Describe the solution you'd like

Adding a scope to exported logs, if such scope exists.

Describe alternatives you've considered

Transform Processor, but it cannot be used in this case since the scope is in a different context than the log.

Additional context

I will work on this one :)

@tamir-michaeli tamir-michaeli added enhancement New feature or request needs triage New item requiring triage labels Apr 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme atoulme removed the needs triage New item requiring triage label Apr 5, 2023
@atoulme
Copy link
Contributor

atoulme commented Apr 5, 2023

It's yours @tamir-michaeli !

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jun 5, 2023
@yotamloe
Copy link
Contributor

yotamloe commented Jun 5, 2023

The solution for this issue is in pr: #20768 waiting for review

@github-actions github-actions bot removed the Stale label Jun 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Aug 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2023

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2023
MovieStoreGuy pushed a commit that referenced this issue Jan 8, 2024
**Description:** <Describe what has changed.>
In cases when an instrumentation library is used to export logs, the
scope field is not being copied to the exported logs.
With this patch, if the scope field is populated in the original log,
the scopeName field in the exported log will contains the name of the
scope.
Ex. Adding a feature - Explain what this achieves.-->

**Link to tracking Issue:** #20659 

**Testing:** Added a test with a scope name.
Changed previous tests to send an empty scope name.

**Documentation:** Added a note in the readme.

---------

Co-authored-by: Alex Boten <alex@boten.ca>
Co-authored-by: Antoine Toulme <antoine@toulme.name>
Co-authored-by: Alex Boten <aboten@lightstep.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this issue Jan 10, 2024
…emetry#20768)

**Description:** <Describe what has changed.>
In cases when an instrumentation library is used to export logs, the
scope field is not being copied to the exported logs.
With this patch, if the scope field is populated in the original log,
the scopeName field in the exported log will contains the name of the
scope.
Ex. Adding a feature - Explain what this achieves.-->

**Link to tracking Issue:** open-telemetry#20659 

**Testing:** Added a test with a scope name.
Changed previous tests to send an empty scope name.

**Documentation:** Added a note in the readme.

---------

Co-authored-by: Alex Boten <alex@boten.ca>
Co-authored-by: Antoine Toulme <antoine@toulme.name>
Co-authored-by: Alex Boten <aboten@lightstep.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants