这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@franciscovalentecastro
Copy link
Contributor

@franciscovalentecastro franciscovalentecastro commented Apr 9, 2025

Description

Adding parse_regex support on Otel Logging. This is based on the OTTL function ExtractPatternsRubyRegex added in GoogleCloudPlatform/opentelemetry-operations-collector#350.

Details to consider

Related issue

b/434196968

How has this been tested?

Checklist:

  • Unit tests
    • Unit tests do not apply.
    • Unit tests have been added/modified and passed for this PR.
  • Integration tests
    • Integration tests do not apply.
    • Integration tests have been added/modified and passed for this PR.
  • Documentation
    • This PR introduces no user visible changes.
    • This PR introduces user visible changes and the corresponding documentation change has been made.
  • Minor version bump
    • This PR introduces no new features.
    • This PR introduces new features, and there is a separate PR to bump the minor version since the last release already.
    • This PR bumps the version.

@franciscovalentecastro franciscovalentecastro marked this pull request as draft April 9, 2025 21:06
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch from c47c9a5 to 648251d Compare April 23, 2025 15:32
@franciscovalentecastro franciscovalentecastro added the kokoro:force-run Forces kokoro to run integration tests on a CL label Apr 25, 2025
@stackdriver-instrumentation-release stackdriver-instrumentation-release removed the kokoro:force-run Forces kokoro to run integration tests on a CL label Apr 25, 2025
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch from c674e32 to 7b90c3a Compare May 1, 2025 17:37
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch from 7b90c3a to ba974ed Compare May 21, 2025 21:46
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch 2 times, most recently from 3a98ac7 to e3d98df Compare June 24, 2025 21:11
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch from 785484a to ba509d5 Compare July 2, 2025 18:17
@franciscovalentecastro franciscovalentecastro changed the title [DNM] Draft parse_regex in otel logging. [confgenerator] Add parse_regex in otel logging. Jul 2, 2025
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch from ba509d5 to a97c696 Compare July 21, 2025 22:44
@franciscovalentecastro franciscovalentecastro marked this pull request as ready for review July 21, 2025 22:47
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch 3 times, most recently from 955bf0f to d5f80a8 Compare July 31, 2025 15:58
@franciscovalentecastro franciscovalentecastro added the kokoro:force-run Forces kokoro to run integration tests on a CL label Jul 31, 2025
@stackdriver-instrumentation-release stackdriver-instrumentation-release removed the kokoro:force-run Forces kokoro to run integration tests on a CL label Jul 31, 2025
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch 5 times, most recently from f703fd3 to 58503fd Compare August 6, 2025 16:17
Copy link
Member

Choose a reason for hiding this comment

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

Feel free to address this in a followup PR:

I would like us to be a little smarter about whether we use onigiruma for the regex. For this code, we can just check if the regex compiles:

output := ottl.ExtractPatternsRubyRegex(fromAccessor, p.Regex)
if _, err := regexp.Compile(p.Regex); err == nil {
  // If it compiles as a Go regex, use the built-in parser
  output = ottl.ExtractPatterns(fromAccessor, p.Regex)
}
// ...
cachedParsedRegex.SetIf(output, fromAccessor.IsPresent()),

I also want to expose this (whether or not a regex is Go-compatible) as a feature flag so we can track this across customer deployments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will do this in a followup PR. Created tracker for this in : b/436898109.

@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch from 58503fd to 06bc949 Compare August 6, 2025 20:52
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-add-otel-parse-regex branch from e74de76 to 19f87d3 Compare August 6, 2025 22:27
@franciscovalentecastro
Copy link
Contributor Author

All integration test failures are unrelated, Ops Agent Integration test - TestDisableSelfLogCollection failures are due to Quota exceeded errors and third part apps integration test - nvml failures are unrelated. Merging.

@franciscovalentecastro franciscovalentecastro merged commit d16b143 into master Aug 7, 2025
55 of 62 checks passed
@franciscovalentecastro franciscovalentecastro deleted the fcovalente-add-otel-parse-regex branch August 7, 2025 00:02
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.

3 participants