Skip to content

Azureblob Exporter: Blob names include serial number after .json instead of before, breaking file extension #39593

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

Closed
gous1924 opened this issue Apr 23, 2025 · 3 comments · Fixed by #39606
Labels
bug Something isn't working exporter/azureblob needs triage New item requiring triage

Comments

@gous1924
Copy link

Component(s)

exporter/azureblob

What happened?

Description

When using the Azure Blob Exporter, the generated blob names append the serial number after the file extension (e.g. .json_3535), resulting in an invalid or misleading file extension.

Steps to Reproduce

  1. Use opentelemetry-collector-contrib:0.124.1 as the base image.
  2. Add the below azureblob exporter configuration.

Expected Result

logs/2024/04/15/logs_15_04_05_3742.json

Actual Result

logs/2024/04/15/logs_15_04_05.json_3742

Collector version

0.124.1

Environment information

OpenTelemetry Collector configuration

exporters:
  azureblob:
    auth:
      type: "connection_string"
      connection_string: "DefaultEndpointsProtocol=https;AccountName=$(AZURE_STORAGE_ACCOUNT);AccountKey=$(AZURE_STORAGE_ACCESS_KEY);EndpointSuffix=core.windows.net"

Log output

Additional context

No response

@gous1924 gous1924 added bug Something isn't working needs triage New item requiring triage labels Apr 23, 2025
Copy link
Contributor

Pinging code owners:

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

@petern48
Copy link
Contributor

petern48 commented Apr 24, 2025

^The bug is clearly there. It's shown even just by looking at the logs from running the unit test (see the PR)

@hgaol
Copy link
Member

hgaol commented Apr 24, 2025

Actually, it's by design. To avoid spending resources on blob name operations when high throughput. And it doesn't affect reading content. But I'm good to add a switch to enable this feature.

atoulme pushed a commit that referenced this issue Apr 27, 2025
…le extension (#39606)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add Fix Azure Blob Storage name to avoid breaking file extension.
Previously the final blob names looked like the following:
```
2025/04/24/traces_00_59_20.json_6651
```
^(this is the actual result I took from one of the raw logs generated
from running the unit test)

Now they properly append the random number before the file extension:
```
2025/04/24/traces_00_59_49_4913.json
```

EDIT: This logic has now been made configurable instead of the default.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes #39593

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added a new test `TestGenerateBlobNameSerialNumBefore`

<!--Describe the documentation added.-->
#### Documentation
Updated the `README.md` with the new config option

<!--Please delete paragraphs that you did not use before submitting.-->
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this issue May 6, 2025
…le extension (open-telemetry#39606)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add Fix Azure Blob Storage name to avoid breaking file extension.
Previously the final blob names looked like the following:
```
2025/04/24/traces_00_59_20.json_6651
```
^(this is the actual result I took from one of the raw logs generated
from running the unit test)

Now they properly append the random number before the file extension:
```
2025/04/24/traces_00_59_49_4913.json
```

EDIT: This logic has now been made configurable instead of the default.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#39593

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added a new test `TestGenerateBlobNameSerialNumBefore`

<!--Describe the documentation added.-->
#### Documentation
Updated the `README.md` with the new config option

<!--Please delete paragraphs that you did not use before submitting.-->
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this issue May 20, 2025
…le extension (open-telemetry#39606)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add Fix Azure Blob Storage name to avoid breaking file extension.
Previously the final blob names looked like the following:
```
2025/04/24/traces_00_59_20.json_6651
```
^(this is the actual result I took from one of the raw logs generated
from running the unit test)

Now they properly append the random number before the file extension:
```
2025/04/24/traces_00_59_49_4913.json
```

EDIT: This logic has now been made configurable instead of the default.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#39593

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added a new test `TestGenerateBlobNameSerialNumBefore`

<!--Describe the documentation added.-->
#### Documentation
Updated the `README.md` with the new config option

<!--Please delete paragraphs that you did not use before submitting.-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/azureblob needs triage New item requiring triage
Projects
None yet
3 participants