Skip to content

Add hit/miss metrics fields for trusted ancestors reporting#720

Merged
fearful-symmetry merged 6 commits intomainfrom
ancestor-metrics-fields
Feb 2, 2026
Merged

Add hit/miss metrics fields for trusted ancestors reporting#720
fearful-symmetry merged 6 commits intomainfrom
ancestor-metrics-fields

Conversation

@fearful-symmetry
Copy link
Copy Markdown
Contributor

@fearful-symmetry fearful-symmetry commented Jan 28, 2026

Change Summary

This adds two custom fields for reporting trusted ancestor lookup hits/misses:

  - Endpoint.metrics.events_cache.trusted_ancestors.hits
  - Endpoint.metrics.events_cache.trusted_ancestors.misses

I've never had to add anything to endpoint-package, so I'm not 100% sure I have everything completed here, even though I've run make clean all.

If you have alternate opinions about how these fields should be named, please tell me, I just came up with these in about 4 seconds.

Sample values

    "events_cache": {
        "trusted_ancestors": {
            "hits": 504,
            "misses": 23578
        }
    },

Release Target

9.x

For mapping changes:

  • I ran make after making the schema changes, and committed all changes
  • If these field(s) are "exception"-able, I made a companion PR to Kibana adding it (see Readme)
  • If this is a metadata change, I also updated both transform destination schemas to match

For Transform changes:

  • The new transform successfully starts in Kibana
  • The corresponding transform destination schema was updated if necessary

@fearful-symmetry fearful-symmetry requested review from a team as code owners January 28, 2026 18:58
Copy link
Copy Markdown
Contributor

@gabriellandau gabriellandau left a comment

Choose a reason for hiding this comment

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

Can you add these fields to the sample metric document for the unit tests?

@fearful-symmetry fearful-symmetry enabled auto-merge (squash) January 29, 2026 15:55
Comment thread custom_schemas/custom_endpoint.yml Outdated
Comment thread package/endpoint/data_stream/metrics/fields/fields.yml Outdated
Comment thread schemas/v1/security/security.yaml
Copy link
Copy Markdown
Member

@pzl pzl left a comment

Choose a reason for hiding this comment

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

Change is good, thank you for including values in sample_event.json.

If double is the appropriate data type here, then you are ok to merge

default_field: false
- name: metrics.events_cache.trusted_ancestors.hits
level: custom
type: double
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we expect these to be decimals? Hits/Misses sounds like a countable whole number thing. Would long, short, integer, unsigned_long be appropriate here?

Quick grep to check what number types we use most commonly, but I didn't look into what any of those fields were (counts of occurrence):

      1    type: float
      2    type: half_float
      7    type: integer
     34    type: double
    122    type: unsigned_long
    332    type: long

@fearful-symmetry fearful-symmetry merged commit 1da9ef2 into main Feb 2, 2026
4 checks passed
@pzl
Copy link
Copy Markdown
Member

pzl commented Feb 2, 2026

@fearful-symmetry I didn't realize auto-merge was on. No worries, but can you still circle back to the data type discussion above?

@fearful-symmetry
Copy link
Copy Markdown
Contributor Author

fearful-symmetry commented Feb 2, 2026

@pzl , yeah, I agree, unsigned_long is probably more appropriate here.

@pzl pzl deleted the ancestor-metrics-fields branch April 21, 2026 14:16
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.

5 participants