Skip to content

Add stored procedure columns to events#1

Merged
cjksplunk merged 57 commits into
mainfrom
add-stored-procedure-columns-to-events
Jan 16, 2026
Merged

Add stored procedure columns to events#1
cjksplunk merged 57 commits into
mainfrom
add-stored-procedure-columns-to-events

Conversation

@cjksplunk
Copy link
Copy Markdown
Owner

Description

Feature, adding sqlserver.procesure_id and sqlserver.procesure_name Attributes to TopQuery and Samples Events

Link to tracking issue

Fixes

Testing

Exitsing tests were updated to verify new Attributes

Documentation

Autogenerated

Comment thread receiver/sqlserverreceiver/scraper.go Outdated
Comment thread receiver/sqlserverreceiver/templates/dbQueryAndTextQuery.tmpl Outdated
Comment thread receiver/sqlserverreceiver/templates/dbQueryAndTextQuery.tmpl Outdated
TopQueryCollection: TopQueryCollection{
MaxQuerySampleCount: 1000,
TopQueryCount: 200,
TopQueryCount: 250,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to increase this to 250?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the direction of the EO.

cjksplunk pushed a commit that referenced this pull request Dec 16, 2025
…-telemetry#43882)

#### Description

Currently `{TraceID,SpanID,ProfileID}` only support byte IDs, however in
open-telemetry#43429
it was brought up that it is difficult to take a string representation
of an ID and directly use that to set a trace ID. This would be for a
hexadecimal string representation comprising 32 bytes. This change
allows the `{TraceID,SpanID,ProfileID}` functions to also work on string
inputs.

In short, the following now works:

```yaml
statements:
  - set(span.trace_id, TraceID("a389023abaa839283293ed323892389d"))
```

#### Link to tracking issue
Fixes
open-telemetry#43429

#### Testing

In addition to the included go tests the following config 


[test-str-trace.yml](https://github.com/user-attachments/files/23217501/test-str-trace.yml)

was used to manually test by invoking `make otelcontribcol &&
./bin/otelcontribcol_darwin_arm64 --config test-str-trace.yml` in one
window and `telemetrygen traces --otlp-insecure --traces 1` in another.
The output is as shown:
<details>
<summary>CLI Output</summary>

```
Span #0
    Trace ID       : a389023abaa839283293ed323892389d
    Parent ID      : e5c516b0c8942eab
    ID             : 1914136d5f9ca838
    Name           : okey-dokey-0
    Kind           : Server
    Start time     : 2025-10-29 18:59:03.312829 +0000 UTC
    End time       : 2025-10-29 18:59:03.312952 +0000 UTC
    Status code    : Unset
    Status message :
Attributes:
     -> network.peer.address: Str(1.2.3.4)
     -> peer.service: Str(telemetrygen-client)
Span #1
    Trace ID       : a389023abaa839283293ed323892389d
    Parent ID      :
    ID             : e5c516b0c8942eab
    Name           : lets-go
    Kind           : Client
    Start time     : 2025-10-29 18:59:03.312829 +0000 UTC
    End time       : 2025-10-29 18:59:03.312952 +0000 UTC
    Status code    : Unset
    Status message :
Attributes:
     -> network.peer.address: Str(1.2.3.4)
     -> peer.service: Str(telemetrygen-server)
```

</details>

#### Documentation

I don't currently see documentation for these functions, but I'm new
here, maybe I'm missing something? Glad to update it

---------

Co-authored-by: Edmo Vamerlatti Costa <11836452+edmocosta@users.noreply.github.com>
sv-splunk and others added 15 commits January 8, 2026 10:02
…to add-stored-procedure-columns-to-events

# Conflicts:
#	receiver/sqlserverreceiver/scraper.go
#	receiver/sqlserverreceiver/templates/dbQueryAndTextQuery.tmpl
#	receiver/sqlserverreceiver/testdata/databaseTopQueryWithoutInstanceName.txt
…o add-stored-procedure-columns-to-events

# Conflicts:
#	receiver/sqlserverreceiver/templates/dbQueryAndTextQuery.tmpl
#	receiver/sqlserverreceiver/testdata/databaseTopQueryWithInstanceName.txt
#	receiver/sqlserverreceiver/testdata/databaseTopQueryWithoutInstanceName.txt
#	receiver/sqlserverreceiver/testdata/expectedQueryTextAndPlanQueryWithInvalidData.yaml
@cjksplunk cjksplunk merged commit 75b17b2 into main Jan 16, 2026
181 of 182 checks passed
cjksplunk added a commit that referenced this pull request Jan 22, 2026
cjksplunk added a commit that referenced this pull request Jan 22, 2026
* Adding the query and tracking of stored procedures to events

* Fixed missing process id

* Removing stored procedure type
Updating tests

* Added changelog entry

* Added changelog entry

* reverted changelog entry

* fix changelog entry

* updates to variable naming and usage

* updates to variable naming and usage

* updates to variable naming and usage

* ran make generate

* Moved QuerySampleCount and TopQueryCount ot of params and reference config obj directly

* Added issue to changelog

* Replaced values with vars

* Integrating stored procedure values for samples

* updates to test data

* Backout unintended merge

* updating change log

* Fix for inaccurate query count being reported in postgresql query metrics collection

* change log

* this fix is for sqlserver

* fill issue details

* go generate

* fix lint

* make gogci

* tweak to samples sql

* Revert checks around sending metrics for countInDb=1, since it's addressing a negligable edge case.

* Updates in prep for testing

* fix lint

* cleanup

* Fix invalid casting and update old test

* Updating topN query to use HAVING instead of external WHERE clause

* Query Tuning

* Adding '''WHERE st.text IS NOT NULL; ''' to topx and samples queries

* Backed out changes to samples query

* Adding documentation for default samples count

* Revert "Add stored procedure columns to events (#1)"

This reverts commit 75b17b2.

---------

Co-authored-by: sreenathv <sreenathv@splunk.com>
cjksplunk added a commit that referenced this pull request Jan 22, 2026
cjksplunk added a commit that referenced this pull request Jan 22, 2026
* Adding the query and tracking of stored procedures to events

* Fixed missing process id

* Removing stored procedure type
Updating tests

* Added changelog entry

* Added changelog entry

* reverted changelog entry

* fix changelog entry

* updates to variable naming and usage

* updates to variable naming and usage

* updates to variable naming and usage

* ran make generate

* Moved QuerySampleCount and TopQueryCount ot of params and reference config obj directly

* Added issue to changelog

* Replaced values with vars

* Integrating stored procedure values for samples

* updates to test data

* Backout unintended merge

* updating change log

* Fix for inaccurate query count being reported in postgresql query metrics collection

* change log

* this fix is for sqlserver

* fill issue details

* go generate

* fix lint

* make gogci

* tweak to samples sql

* Revert checks around sending metrics for countInDb=1, since it's addressing a negligable edge case.

* Updates in prep for testing

* fix lint

* cleanup

* Fix invalid casting and update old test

* Updating topN query to use HAVING instead of external WHERE clause

* Query Tuning

* Adding '''WHERE st.text IS NOT NULL; ''' to topx and samples queries

* Backed out changes to samples query

* Adding documentation for default samples count

* Revert "Add stored procedure columns to events (#1)"

This reverts commit 75b17b2.

* Reapply "Add stored procedure columns to events (#1)"

This reverts commit 135c988.

---------

Co-authored-by: sreenathv <sreenathv@splunk.com>
cjksplunk added a commit that referenced this pull request Jan 22, 2026
* Adding the query and tracking of stored procedures to events

* Fixed missing process id

* Removing stored procedure type
Updating tests

* Added changelog entry

* Added changelog entry

* reverted changelog entry

* fix changelog entry

* updates to variable naming and usage

* updates to variable naming and usage

* updates to variable naming and usage

* ran make generate

* Moved QuerySampleCount and TopQueryCount ot of params and reference config obj directly

* Added issue to changelog

* Replaced values with vars

* Integrating stored procedure values for samples

* updates to test data

* Backout unintended merge

* updating change log

* Fix for inaccurate query count being reported in postgresql query metrics collection

* change log

* this fix is for sqlserver

* fill issue details

* go generate

* fix lint

* make gogci

* tweak to samples sql

* Revert checks around sending metrics for countInDb=1, since it's addressing a negligable edge case.

* Updates in prep for testing

* fix lint

* cleanup

* Fix invalid casting and update old test

* Updating topN query to use HAVING instead of external WHERE clause

* Query Tuning

* Adding '''WHERE st.text IS NOT NULL; ''' to topx and samples queries

* Backed out changes to samples query

* Adding documentation for default samples count

* Revert "Add stored procedure columns to events (#1)"

This reverts commit 75b17b2.

* Reapply "Add stored procedure columns to events (#1)"

This reverts commit 135c988.

* removing not null from samples again

---------

Co-authored-by: sreenathv <sreenathv@splunk.com>
cjksplunk added a commit that referenced this pull request Jan 23, 2026
* Adding the query and tracking of stored procedures to events

* Fixed missing process id

* Removing stored procedure type
Updating tests

* Added changelog entry

* Added changelog entry

* reverted changelog entry

* fix changelog entry

* updates to variable naming and usage

* updates to variable naming and usage

* updates to variable naming and usage

* ran make generate

* Moved QuerySampleCount and TopQueryCount ot of params and reference config obj directly

* Added issue to changelog

* Replaced values with vars

* Integrating stored procedure values for samples

* updates to test data

* Backout unintended merge

* updating change log

* Fix for inaccurate query count being reported in postgresql query metrics collection

* change log

* this fix is for sqlserver

* fill issue details

* go generate

* fix lint

* make gogci

* tweak to samples sql

* Revert checks around sending metrics for countInDb=1, since it's addressing a negligable edge case.

* Updates in prep for testing

* fix lint

* cleanup

* Fix invalid casting and update old test

* Updating topN query to use HAVING instead of external WHERE clause

* Query Tuning

* Adding '''WHERE st.text IS NOT NULL; ''' to topx and samples queries

* Backed out changes to samples query

* Adding documentation for default samples count

* Revert "Add stored procedure columns to events (#1)"

This reverts commit 75b17b2.

* Reapply "Add stored procedure columns to events (#1)"

This reverts commit 135c988.

* removing not null from samples again

* [chore][processor/resourcedetection] Add E2E tests for upcloud detector (open-telemetry#45584)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Add E2E tests for Upcloud detector

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

---------

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* [chore][processor/resourcedetection] Add E2E tests for vultr detector (open-telemetry#45583)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Add E2E tests for Vultr detector

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

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* [chore][processor/resourcedetection] Add E2E tests for ec2 detector (open-telemetry#45438)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Add E2E tests for EC2 detector

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

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* [chore][processor/resourcedetection] Add E2E tests for scaleway detector (open-telemetry#45590)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Add E2E tests for scaleway detector

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

---------

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* [chore][processor/resourcedetection] Add E2E tests for azure detector (open-telemetry#45569)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Add E2E tests for Azure detector

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

---------

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* Update Move functions in routing connector to not use pointer. (open-telemetry#45563)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

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

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->

* [receiver/filelog] Suppress repeated permission denied errors (open-telemetry#44350)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Added logic to suppress repeated error logs due to file permission
errors within the `filelog` receiver.

- Updated `makeFingerprint` to check for permission errors via
[os.isPermission](https://pkg.go.dev/os#IsPermission)
- Log an error only on the first occurrence for a given file path and
add it to an in-memory map, guarded by a mutex to avoid race conditions
for concurrent read/writes.
- Debug log only for subsequent read attempt (to avoid spam)
- When the file becomes readable, info log a message and remove the path
from the stored set

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

<!--Describe what testing was performed and which tests were added.-->
#### Testing
New unit test verifying:
- First unreadable-open produces exactly one Error-level log.
- Second attempt does not produce another Error-level log.
- When permissions are restored, an Info-level `Previously
unreadable...` message appears.

NOTE: Test skips Windows due to unreliable os.Chmod behavior

<!--Describe the documentation added.-->
#### Documentation
Added changelog yaml entry summarizing the issue and fix.

<!--Please delete paragraphs that you did not use before submitting.-->

* [pkg/stanza/trim] Improve performance of Trailing and Leading (open-telemetry#45281)

#### Description

Improves the performance of `Trailing` and `Leading` functions. You can
see it in the benchmarks results here:

```
goos: linux
goarch: amd64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/trim
cpu: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
                                    │ Previous code │               This PR                │
                                    │    sec/op     │    sec/op     vs base                │
TrimFuncs/leading/small_clean-16      20.345n ± 23%   2.924n ± 18%  -85.63% (p=0.000 n=10)
TrimFuncs/leading/small_dirty-16       24.65n ± 30%   12.77n ± 10%  -48.22% (p=0.000 n=10)
TrimFuncs/leading/all_space-16         25.91n ± 13%   13.38n ±  8%  -48.35% (p=0.000 n=10)
TrimFuncs/leading/large_dirty-16      21.440n ± 15%   8.457n ±  7%  -60.56% (p=0.000 n=10)
TrimFuncs/trailing/small_clean-16     16.400n ±  8%   2.737n ±  3%  -83.31% (p=0.000 n=10)
TrimFuncs/trailing/small_dirty-16      18.88n ± 14%   10.37n ±  8%  -45.10% (p=0.000 n=10)
TrimFuncs/trailing/all_space-16        22.61n ±  5%   12.10n ±  7%  -46.50% (p=0.000 n=10)
TrimFuncs/trailing/large_dirty-16     19.085n ± 10%   7.271n ± 22%  -61.90% (p=0.000 n=10)
TrimFuncs/whitespace/small_clean-16   29.895n ±  4%   3.788n ±  3%  -87.33% (p=0.000 n=10)
TrimFuncs/whitespace/small_dirty-16    41.10n ± 11%   17.20n ±  3%  -58.16% (p=0.000 n=10)
TrimFuncs/whitespace/all_space-16      24.47n ±  7%   13.22n ± 17%  -45.97% (p=0.000 n=10)
TrimFuncs/whitespace/large_dirty-16    36.59n ± 15%   12.82n ± 15%  -64.95% (p=0.000 n=10)
TrimFuncs/nop/small_clean-16           2.071n ±  8%   1.937n ±  7%        ~ (p=0.052 n=10)
TrimFuncs/nop/small_dirty-16           2.048n ±  7%   1.939n ±  4%        ~ (p=0.063 n=10)
TrimFuncs/nop/all_space-16             2.346n ± 10%   2.022n ±  4%  -13.83% (p=0.000 n=10)
TrimFuncs/nop/large_dirty-16           2.355n ±  9%   2.175n ± 12%   -7.62% (p=0.023 n=10)
WithFunc/baseline_scanlines-16         215.8n ± 11%   219.5n ±  3%        ~ (p=0.755 n=10)
WithFunc/with_whitespace-16            237.3n ± 12%   237.9n ± 13%        ~ (p=0.912 n=10)
ToLength/under_limit-16                241.7n ± 12%   267.3n ± 17%  +10.57% (p=0.002 n=10)
ToLength/over_limit-16                 266.9n ± 12%   247.1n ± 20%        ~ (p=0.393 n=10)
geomean                                23.72n         12.33n        -48.00%

                                    │ Previous code │               This PR               │
                                    │     B/op      │    B/op     vs base                 │
TrimFuncs/leading/small_clean-16       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/leading/small_dirty-16       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/leading/all_space-16         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/leading/large_dirty-16       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/trailing/small_clean-16      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/trailing/small_dirty-16      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/trailing/all_space-16        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/trailing/large_dirty-16      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/whitespace/small_clean-16    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/whitespace/small_dirty-16    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/whitespace/all_space-16      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/whitespace/large_dirty-16    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/nop/small_clean-16           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/nop/small_dirty-16           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/nop/all_space-16             0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/nop/large_dirty-16           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
WithFunc/baseline_scanlines-16         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
WithFunc/with_whitespace-16            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
ToLength/under_limit-16                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
ToLength/over_limit-16                 0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                           ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                    │ Previous code │               This PR               │
                                    │   allocs/op   │ allocs/op   vs base                 │
TrimFuncs/leading/small_clean-16       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/leading/small_dirty-16       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/leading/all_space-16         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/leading/large_dirty-16       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/trailing/small_clean-16      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/trailing/small_dirty-16      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/trailing/all_space-16        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/trailing/large_dirty-16      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/whitespace/small_clean-16    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/whitespace/small_dirty-16    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/whitespace/all_space-16      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/whitespace/large_dirty-16    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/nop/small_clean-16           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/nop/small_dirty-16           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/nop/all_space-16             0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
TrimFuncs/nop/large_dirty-16           0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
WithFunc/baseline_scanlines-16         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
WithFunc/with_whitespace-16            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
ToLength/under_limit-16                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
ToLength/over_limit-16                 0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                           ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean
```

* [ci] Ensure github token is available for github cli (open-telemetry#45602)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

I enabled the usage of the `gh` CLI in
open-telemetry#45477,
but I forgot to ensure the variable `GH_TOKEN` is configured with the
proper value.

This will fix that issue, but the workflow should be triggered manually
after this merge.

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

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* Updating documentation

---------

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Co-authored-by: sreenathv <sreenathv@splunk.com>
Co-authored-by: Paulo Dias <44772900+paulojmdias@users.noreply.github.com>
Co-authored-by: Vengal rao <vengalraoguttha@users.noreply.github.com>
Co-authored-by: Keagan Peet <nobrac34@gmail.com>
Co-authored-by: Constança Manteigas <113898685+constanca-m@users.noreply.github.com>
cjksplunk added a commit that referenced this pull request Jan 27, 2026
* Adding the query and tracking of stored procedures to events

* Fixed missing process id

* Removing stored procedure type
Updating tests

* Added changelog entry

* Added changelog entry

* reverted changelog entry

* fix changelog entry

* updates to variable naming and usage

* updates to variable naming and usage

* updates to variable naming and usage

* ran make generate

* Moved QuerySampleCount and TopQueryCount ot of params and reference config obj directly

* Added issue to changelog

* Replaced values with vars

* Integrating stored procedure values for samples

* updates to test data

* Backout unintended merge

* updating change log

* Fix for inaccurate query count being reported in postgresql query metrics collection

* change log

* this fix is for sqlserver

* fill issue details

* go generate

* fix lint

* make gogci

* tweak to samples sql

* Revert checks around sending metrics for countInDb=1, since it's addressing a negligable edge case.

* Updates in prep for testing

* fix lint

* cleanup

* Fix invalid casting and update old test

* Updating topN query to use HAVING instead of external WHERE clause

* Query Tuning

* Adding '''WHERE st.text IS NOT NULL; ''' to topx and samples queries

* Backed out changes to samples query

* Adding documentation for default samples count

* Revert "Add stored procedure columns to events (#1)"

This reverts commit 75b17b2.

* Reapply "Add stored procedure columns to events (#1)"

This reverts commit 135c988.

* removing not null from samples again

* Updating documentation

* Updates made per PR feedback.

---------

Co-authored-by: sreenathv <sreenathv@splunk.com>
cjksplunk added a commit that referenced this pull request Jan 27, 2026
* Adding the query and tracking of stored procedures to events

* Fixed missing process id

* Removing stored procedure type
Updating tests

* Added changelog entry

* Added changelog entry

* reverted changelog entry

* fix changelog entry

* updates to variable naming and usage

* updates to variable naming and usage

* updates to variable naming and usage

* ran make generate

* Moved QuerySampleCount and TopQueryCount ot of params and reference config obj directly

* Added issue to changelog

* Replaced values with vars

* Integrating stored procedure values for samples

* updates to test data

* Backout unintended merge

* updating change log

* Fix for inaccurate query count being reported in postgresql query metrics collection

* change log

* this fix is for sqlserver

* fill issue details

* go generate

* fix lint

* make gogci

* tweak to samples sql

* Revert checks around sending metrics for countInDb=1, since it's addressing a negligable edge case.

* Updates in prep for testing

* fix lint

* cleanup

* Fix invalid casting and update old test

* Updating topN query to use HAVING instead of external WHERE clause

* Query Tuning

* Adding '''WHERE st.text IS NOT NULL; ''' to topx and samples queries

* Backed out changes to samples query

* Adding documentation for default samples count

* Revert "Add stored procedure columns to events (#1)"

This reverts commit 75b17b2.

* Reapply "Add stored procedure columns to events (#1)"

This reverts commit 135c988.

* removing not null from samples again

* Updating documentation

* Updates made per PR feedback.

* Removing unused comment

---------

Co-authored-by: sreenathv <sreenathv@splunk.com>
cjksplunk added a commit that referenced this pull request Feb 3, 2026
* Adding the query and tracking of stored procedures to events

* Fixed missing process id

* Removing stored procedure type
Updating tests

* Added changelog entry

* Added changelog entry

* reverted changelog entry

* fix changelog entry

* updates to variable naming and usage

* updates to variable naming and usage

* updates to variable naming and usage

* ran make generate

* Moved QuerySampleCount and TopQueryCount ot of params and reference config obj directly

* Added issue to changelog

* Replaced values with vars

* Integrating stored procedure values for samples

* updates to test data

* Backout unintended merge

* updating change log

* Fix for inaccurate query count being reported in postgresql query metrics collection

* change log

* this fix is for sqlserver

* fill issue details

* go generate

* fix lint

* make gogci

* tweak to samples sql

* Revert checks around sending metrics for countInDb=1, since it's addressing a negligable edge case.

* Updates in prep for testing

* fix lint

* cleanup

* Fix invalid casting and update old test

* Updating topN query to use HAVING instead of external WHERE clause

* Query Tuning

* Adding '''WHERE st.text IS NOT NULL; ''' to topx and samples queries

* Backed out changes to samples query

* Adding documentation for default samples count

* Revert "Add stored procedure columns to events (#1)"

This reverts commit 75b17b2.

* Reapply "Add stored procedure columns to events (#1)"

This reverts commit 135c988.

* removing not null from samples again

* Updating documentation

* Updates made per PR feedback.

* Removing unused comment

* updated autogen docs

---------

Co-authored-by: sreenathv <sreenathv@splunk.com>
cjksplunk added a commit that referenced this pull request Feb 3, 2026
* Adding the query and tracking of stored procedures to events

* Fixed missing process id

* Removing stored procedure type
Updating tests

* Added changelog entry

* Added changelog entry

* reverted changelog entry

* fix changelog entry

* updates to variable naming and usage

* updates to variable naming and usage

* updates to variable naming and usage

* ran make generate

* Moved QuerySampleCount and TopQueryCount ot of params and reference config obj directly

* Added issue to changelog

* Replaced values with vars

* Integrating stored procedure values for samples

* updates to test data

* Backout unintended merge

* updating change log

* Fix for inaccurate query count being reported in postgresql query metrics collection

* change log

* this fix is for sqlserver

* fill issue details

* go generate

* fix lint

* make gogci

* tweak to samples sql

* Revert checks around sending metrics for countInDb=1, since it's addressing a negligable edge case.

* Updates in prep for testing

* fix lint

* cleanup

* Fix invalid casting and update old test

* Updating topN query to use HAVING instead of external WHERE clause

* Query Tuning

* Adding '''WHERE st.text IS NOT NULL; ''' to topx and samples queries

* Backed out changes to samples query

* Adding documentation for default samples count

* Revert "Add stored procedure columns to events (#1)"

This reverts commit 75b17b2.

* Reapply "Add stored procedure columns to events (#1)"

This reverts commit 135c988.

* removing not null from samples again

* Updating documentation

* Updates made per PR feedback.

* Removing unused comment

* updated autogen docs

---------

Co-authored-by: sreenathv <sreenathv@splunk.com>
cjksplunk pushed a commit that referenced this pull request Feb 24, 2026
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add `Base64Encode` OTTL converter function to encode strings into base64
format with support for multiple variants (`base64`, `base64-raw`,
`base64-url`, `base64-raw-url`). This function addresses the need to
handle characters not allowed by certain exporters like NATS Core.
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#46071

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Tested manually and added unit and e2e tests.
Test config:
```yaml
processors:
  transform:
    log_statements:
      - context: log
        statements:
          - set(attributes["encoded_default"], Base64Encode(attributes["plain_text"]))
          
          - set(attributes["encoded_base64_raw"], Base64Encode(attributes["plain_text"], "base64-raw"))
          
          - set(attributes["encoded_base64_url"], Base64Encode(attributes["plain_text"], "base64-url"))
          
          - set(attributes["encoded_base64_raw_url"], Base64Encode(attributes["plain_text"], "base64-raw-url"))
```
Test input:
```json
{"plain_text": "test string"}
{"plain_text": "hello world"}
{"plain_text": "special chars: @#$%"}
{"plain_text": "URL encoding test: https://example.com?param=value&other=123"}
```
Test result:
```
LogRecord #0
Body: Str({"plain_text": "test string"})
Attributes:
     -> log.file.name: Str(test_data.log)
     -> plain_text: Str(test string)
     -> encoded_default: Str(dGVzdCBzdHJpbmc=)
     -> encoded_base64_raw: Str(dGVzdCBzdHJpbmc)
     -> encoded_base64_url: Str(dGVzdCBzdHJpbmc=)
     -> encoded_base64_raw_url: Str(dGVzdCBzdHJpbmc)
LogRecord #1
Body: Str({"plain_text": "hello world"})
Attributes:
     -> log.file.name: Str(test_data.log)
     -> plain_text: Str(hello world)
     -> encoded_default: Str(aGVsbG8gd29ybGQ=)
     -> encoded_base64_raw: Str(aGVsbG8gd29ybGQ)
     -> encoded_base64_url: Str(aGVsbG8gd29ybGQ=)
     -> encoded_base64_raw_url: Str(aGVsbG8gd29ybGQ)
LogRecord #2
Body: Str({"plain_text": "special chars: @#$%"})
Attributes:
     -> log.file.name: Str(test_data.log)
     -> plain_text: Str(special chars: @#$%)
     -> encoded_default: Str(c3BlY2lhbCBjaGFyczogQCMkJQ==)
     -> encoded_base64_raw: Str(c3BlY2lhbCBjaGFyczogQCMkJQ)
     -> encoded_base64_url: Str(c3BlY2lhbCBjaGFyczogQCMkJQ==)
     -> encoded_base64_raw_url: Str(c3BlY2lhbCBjaGFyczogQCMkJQ)
LogRecord #3
Body: Str({"plain_text": "URL encoding test: https://example.com?param=value&other=123"})
Attributes:
     -> log.file.name: Str(test_data.log)
     -> plain_text: Str(URL encoding test: https://example.com?param=value&other=123)
     -> encoded_default: Str(VVJMIGVuY29kaW5nIHRlc3Q6IGh0dHBzOi8vZXhhbXBsZS5jb20/cGFyYW09dmFsdWUmb3RoZXI9MTIz)
     -> encoded_base64_raw: Str(VVJMIGVuY29kaW5nIHRlc3Q6IGh0dHBzOi8vZXhhbXBsZS5jb20/cGFyYW09dmFsdWUmb3RoZXI9MTIz)
     -> encoded_base64_url: Str(VVJMIGVuY29kaW5nIHRlc3Q6IGh0dHBzOi8vZXhhbXBsZS5jb20_cGFyYW09dmFsdWUmb3RoZXI9MTIz)
     -> encoded_base64_raw_url: Str(VVJMIGVuY29kaW5nIHRlc3Q6IGh0dHBzOi8vZXhhbXBsZS5jb20_cGFyYW09dmFsdWUmb3RoZXI9MTIz)
```
<!--Describe the documentation added.-->
#### Documentation
Updated `README.md` with function documentation, usage examples, and
supported variants.

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Edmo Vamerlatti Costa <11836452+edmocosta@users.noreply.github.com>
cjksplunk pushed a commit that referenced this pull request Apr 15, 2026
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Add support timeout setting for telemetrygen 


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

#### Testing

Sending traces to a collector that has an artificial delay of `10s`
before answering
```
❯ go run . traces --traces 1 --timeout 5s --otlp-insecure
2026-04-01T17:29:31.673+0300	INFO	channelz/trace.go:200	[core] [Channel #1] Channel Connectivity change to READY	{"grpc_log": true}
2026/04/01 17:29:34 traces export: context deadline exceeded: rpc error: code = DeadlineExceeded desc = context deadline exceeded
2026-04-01T17:29:34.980+0300	INFO	channelz/trace.go:200	[core] [Channel #1] Channel Connectivity change to SHUTDOWN	{"grpc_log": true}
```

```
❯ go run . traces --traces 1 --timeout 15s --otlp-insecure
2026-04-01T17:30:42.046+0300	INFO	channelz/trace.go:200	[core] [Channel #1] Channel Connectivity change to READY	{"grpc_log": true}
2026-04-01T17:30:52.052+0300	INFO	channelz/trace.go:200	[core] [Channel #1] Channel Connectivity change to SHUTDOWN	{"grpc_log": true}
```
cjksplunk pushed a commit that referenced this pull request Apr 17, 2026
…pen-telemetry#45518)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
The `extract_percentile_metric` function creates a new Gauge metric from
a Histogram or ExponentialHistogram by calculating the specified
percentile value from the bucket counts. A metric will only be created
if there is at least one data point.

`percentile` is a float64 value between 0 and 100 representing the
desired percentile to extract (e.g., 50 for median, 95 for p95, 99 for
p99).

`suffix` is an optional string that defines the suffix for the metric
name. By default, it is set to `_p{percentile}` (e.g., `_p50`, `_p95`,
`_p99`).

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

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Included unit tests and tested manually with this configuration:

``` yaml
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

exporters:
  debug:
    verbosity: detailed
    sampling_initial: 10000
    sampling_thereafter: 10000

processors:
  transform:
    error_mode: ignore
    metric_statements:
      - context: metric
        statements:
          - extract_percentile_metric(50.0)
          - extract_percentile_metric(95.0)
          - extract_percentile_metric(99.0, "_p99_custom")

service:
  telemetry:
    metrics:
      level: none
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [transform]
      exporters:
        - debug

```
tested with `telemetrygen` tool with params to generate regular
histogram metrics:
```
./bin/telemetrygen_darwin_arm64 metrics \                    ok | 14:34:29 
  --otlp-insecure \
  --otlp-endpoint localhost:4317 \
  --metrics 1 \
  --otlp-attributes 'service.name="histogram-service"' \
  --metric-type Histogram \
  --otlp-metric-name "http.server.duration"
```
Obtained output: 
```
Metric #1
Descriptor:
     -> Name: http.server.duration_p50
     -> Description:  (p50)
     -> Unit: 
     -> DataType: Gauge
NumberDataPoints #0
StartTimestamp: 2026-01-20 13:34:29.409727 +0000 UTC
Timestamp: 2026-01-20 13:34:29.409727 +0000 UTC
Value: 137.500000
Metric #2
Descriptor:
     -> Name: http.server.duration_p95
     -> Description:  (p95)
     -> Unit: 
     -> DataType: Gauge
NumberDataPoints #0
StartTimestamp: 2026-01-20 13:34:29.409727 +0000 UTC
Timestamp: 2026-01-20 13:34:29.409727 +0000 UTC
Value: 750.000000
Metric #3
Descriptor:
     -> Name: http.server.duration_p99_custom
     -> Description:  (p99)
     -> Unit: 
     -> DataType: Gauge
NumberDataPoints #0
StartTimestamp: 2026-01-20 13:34:29.409727 +0000 UTC
Timestamp: 2026-01-20 13:34:29.409727 +0000 UTC
Value: 750.000000 # p99 is placed in last bucket which is [bucket_lower_bound, + Inf ]. Cannot interpolate with Inf values so it is necessary to use lowerbound (750)
```
Tested with Exponential histogram as well:
```
./bin/telemetrygen_darwin_arm64 metrics \                    ok | 14:42:11 
  --otlp-insecure \
  --otlp-endpoint localhost:4317 \
  --metrics 1 \
  --otlp-attributes 'service.name="histogram-service"' \
  --metric-type ExponentialHistogram \
  --otlp-metric-name "http.server.duration"
```
and got the output:
```
Metric #1
Descriptor:
     -> Name: http.server.duration_p50
     -> Description:  (p50)
     -> Unit: 
     -> DataType: Gauge
NumberDataPoints #0
StartTimestamp: 2026-01-20 13:42:11.599314 +0000 UTC
Timestamp: 2026-01-20 13:42:11.599315 +0000 UTC
Value: 545.301038
Metric #2
Descriptor:
     -> Name: http.server.duration_p95
     -> Description:  (p95)
     -> Unit: 
     -> DataType: Gauge
NumberDataPoints #0
StartTimestamp: 2026-01-20 13:42:11.599314 +0000 UTC
Timestamp: 2026-01-20 13:42:11.599315 +0000 UTC
Value: 961.465253
Metric #3
Descriptor:
     -> Name: http.server.duration_p99_custom
     -> Description:  (p99)
     -> Unit: 
     -> DataType: Gauge
NumberDataPoints #0
StartTimestamp: 2026-01-20 13:42:11.599314 +0000 UTC
Timestamp: 2026-01-20 13:42:11.599315 +0000 UTC
Value: 1024.000000
```
<!--Describe the documentation added.-->
#### Documentation
Added proper documentation to transform processor `README.md`.

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Edmo Vamerlatti Costa <11836452+edmocosta@users.noreply.github.com>
cjksplunk pushed a commit that referenced this pull request Apr 21, 2026
…arsing in %Z field (open-telemetry#47767)

#### Description
Adds a new optional time_zone_locations field to TimeParser that maps
timezone abbreviations to IANA location names. This allows correct
parsing of log streams that contain timestamps with multiple timezone
abbreviations (e.g. IST, PDT, NZST) in a single operator block.

Changes:


[time.go](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
— added [TimeZoneLocations
map[string]string](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
field (mapstructure: time_zone_locations), resolveLocation() method, and
a validation that rejects time_zone_locations when the layout contains
no %Z/MST directive

[time_test.go](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
— added
[TestTimeZoneLocations](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html),
[TestTimeZoneLocationsErrors](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html),
and
[TestUnmarshalTimeConfig/time_zone_locations](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)

[timestamp.yaml](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
— added time_zone_locations unmarshal fixture

[timestamp.md](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
— documented
[location](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
and time_zone_locations fields; added multi-timezone example

[time_parser.md](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
— added
[location](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
and time_zone_locations to the configuration fields table


#### Link to tracking issue
Fixes
[47594](open-telemetry#47594)

#### Testing
Unit tests added and verified existing and new tests are passing.

**Manual testing:**

**Test log lines used:**
```
Wed Aug 27 15:08:58 IST 2025 Log from India
Wed Aug 20 14:08:48 CST 2025 Log from China
Wed Jul 16 10:00:00 NZST 2025 Log from New Zealand
```

**Without time_zone_locations param added/old behaviour:** 

[collector-config.yaml](https://github.com/user-attachments/files/26901647/collector-config.yaml)



timeout 15 ./otelcol-tz-test/otelcol-tz-test --config
collector-config.yaml 2>&1 | grep -E "LogRecord|Timestamp:|Body:" ||
true
LogRecord #0
ObservedTimestamp: 2026-04-20 14:11:36.028277 +0000 UTC
Timestamp: 2025-08-27 09:38:58 +0000 UTC
Body: Str(Wed Aug 27 15:08:58 IST 2025 Log from India)
LogRecord #1
ObservedTimestamp: 2026-04-20 14:11:36.028279 +0000 UTC
Timestamp: 1970-01-01 00:00:00 +0000 UTC
Body: Str(Wed Aug 20 14:08:48 CST 2025 Log from China)
LogRecord #0
ObservedTimestamp: 2026-04-20 14:11:36.628855 +0000 UTC
Timestamp: 1970-01-01 00:00:00 +0000 UTC
Body: Str(Wed Jul 16 10:00:00 NZST 2025 Log from New Zealand)

NZST and CST are not parsed properly.

**With time_zone_locations param configured:**

[collector-config.yaml](https://github.com/user-attachments/files/26901658/collector-config.yaml)


timeout 15 ./otelcol-tz-test/otelcol-tz-test --config
collector-config.yaml 2>&1 | grep -E "LogRecord|Timestamp:|Body:" ||
true
LogRecord #0
ObservedTimestamp: 2026-04-20 14:12:22.096579 +0000 UTC
Timestamp: 2025-08-27 09:38:58 +0000 UTC
Body: Str(Wed Aug 27 15:08:58 IST 2025 Log from India)
LogRecord #1
ObservedTimestamp: 2026-04-20 14:12:22.096582 +0000 UTC
Timestamp: 2025-08-20 06:08:48 +0000 UTC
Body: Str(Wed Aug 20 14:08:48 CST 2025 Log from China)
LogRecord #0
ObservedTimestamp: 2026-04-20 14:12:22.696974 +0000 UTC
Timestamp: 2025-07-15 22:00:00 +0000 UTC
Body: Str(Wed Jul 16 10:00:00 NZST 2025 Log from New Zealand)

All timezone abbreviations are parsed properly into their respective UTC
times.


#### Documentation
Updated
[timestamp.md](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
and
[time_parser.md](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html)
to document the new time_zone_locations field and add a multi-timezone
parsing example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants