Skip to content

Conversation

@BenElferink
Copy link
Contributor

@BenElferink BenElferink commented May 21, 2025

Following up after: #2826


This PR adds API support for the new HTTP Headers rule.
This PR also adds the rule to Odigos Docs.

The UI itself still needs an update via the UI-Kit: https://github.com/odigos-io/ui-kit/pull/134

@BenElferink BenElferink added enhancement New feature or request frontend labels May 21, 2025
@BenElferink BenElferink changed the title feat: add support for HTTP Headers instrumentation rule in UI backend feat: add support for HTTP Headers instrumentation rule in UI backend (+ add docs) May 21, 2025
@BenElferink BenElferink added the documentation Improvements or additions to documentation label May 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends the UI backend to support a new HTTP Headers instrumentation rule and adds corresponding documentation.

  • Introduce HeadersCollection in service layer conversions and input builders
  • Extend GraphQL schema, models, and resolvers to expose headersCollection
  • Add “Headers Collection” docs and update navigation order in docs

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/services/instrumentationrule.go Added getHeadersCollectionInput, convertHeadersCollection, and wired headersCollection into rule DTOs
frontend/graph/schema.graphqls Defined HeadersCollection/HeadersCollectionInput, updated InstrumentationRule and its input
frontend/graph/model/models_gen.go Added HeadersCollection types and updated InstrumentationRule struct fields and enum constants
frontend/graph/generated.go Extended execution functions to marshal/unmarshal headersCollection and updated resolver switch cases
docs/pipeline/rules/introduction.mdx Inserted link to the new Headers Collection page
docs/pipeline/rules/headerscollection.mdx New doc page for the Headers Collection rule
docs/mint.json Updated sidebar order to include Headers Collection
Comments suppressed due to low confidence (2)

frontend/services/instrumentationrule.go:11

  • The new headersCollection field isn’t evaluated here, so header‐only rules will fall back to UnknownType. Extend this function to check rule.HeadersCollection and return InstrumentationRuleTypeHeadersCollection when appropriate.
func deriveTypeFromRule(rule *model.InstrumentationRule)

frontend/services/instrumentationrule.go:122

  • There is no existing unit test for getHeadersCollectionInput. Adding tests for various HeadersCollectionInput cases (nil, empty slice, populated slice) will prevent regressions.
func getHeadersCollectionInput(input model.InstrumentationRuleInput) *instrumentationrules.HttpHeadersCollection {

BenElferink and others added 4 commits May 21, 2025 12:26
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

LGTM.

Added few suggestion to the docs which can be nice to add (but optional)


<AccordionGroup>
<Accordion title="headerKeys">
**headerKeys** `string[]` : Limit payload collection to specific header keys.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it can be valuable to also describe how this key is collected.

e.g. that an header key "foo" with value "bar" will be collected as span attribute named http.request.header.foo with attribute value ["bar"] (or http.response.header.foo if this is for response)

@edeNFed just making sure java is implemented this way (semconv)

This Instrumentation Rule is currently only available with the Odigos **Enterprise** plan.<br />
[Contact us](https://odigos.io/) for more information.
</Info>

Copy link
Collaborator

Choose a reason for hiding this comment

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

for http we have both client/server, and request/response.

I guess this configuration option will apply to all of them? might be worth mentioning here

@BenElferink BenElferink enabled auto-merge (squash) May 25, 2025 07:09
@BenElferink BenElferink merged commit 9ee1003 into odigos-io:main May 25, 2025
54 checks passed
@BenElferink BenElferink deleted the headers-rule-ui-backend branch May 29, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants