Skip to content

Test entitiy#2

Open
tharun0064 wants to merge 7 commits into
mainfrom
test-entitiy
Open

Test entitiy#2
tharun0064 wants to merge 7 commits into
mainfrom
test-entitiy

Conversation

@tharun0064

Copy link
Copy Markdown
Owner

Relevant information

Checklist

  • I've read the guidelines and understand the acceptance criteria.
  • The value of the attribute marked as identifier will be unique and valid.
  • I've confirmed that my entity type wasn't already defined. If it is I'm providing an explanation above.

tharun0064 pushed a commit that referenced this pull request Jan 9, 2026
tharun0064 pushed a commit that referenced this pull request Apr 23, 2026
newrelic#2751)

* feat(redis): add OpenTelemetry synthesis rule with service.instance.id

- Add infra_redisinstance_otel synthesis rule
- Support service.instance.id identifier pattern
- Include required resource attributes (service.name, service.instance.id, host.name, host.id)
- Include optional attributes (redis.cluster.name, redis.cluster.enabled, redis.maxmemory, redis.persistence.enabled)
- Support both redis. and redis_ metric prefixes
- Add K8s and cloud provider attributes
- Prevent duplicate entities by making rules mutually exclusive
- Update goldenTags with new attributes
- Add test case with new attributes pattern
- Create definition.stg.yml for staging
- Preserve existing server.address:server.port synthesis rule

* fix(redis): correct synthesis rule syntax for validation

- Remove unsupported anyOf syntax from conditions
- Simplify metricName condition to use redis. prefix
- Simplify entity trigger to use redis.role present condition
- Ensure schema validation passes

* feat(redis): update for latest collector and remove service.name

- Add otel.library.name condition for latest collector format:
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver
- Remove service.name from required resource attributes
- Update synthesis rule to trigger only on redis.role presence
- Support both old otelcol/redisreceiver and new collector formats

* feat(redis): update staging file with same collector changes

- Add otel.library.name condition for latest collector format in staging
- Remove service.name from staging file tags
- Keep staging file in sync with main definition

* fix(redis): update test data for validation

- Add missing eventType field to both test data points
- Update test case #2 to use new collector format:
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver
- Ensure test data matches synthesis rule conditions
- Fix validation error for INFRA-REDISINSTANCE synthesis rules

* feat(redis): add TTL configurations to host and K8s attributes

- Add ttl: P1D to host.name and host.id for dynamic host tracking
- Add ttl: P1D to k8s.namespace.name and k8s.pod.name for container lifecycle
- Consistent with Kafka broker TTL patterns
- Applied to both definition.yml and definition.stg.yml
- Ensures proper cleanup of dynamic attributes in containerized environments

---------

Co-authored-by: David Gonzalez <davidgonzalez@newrelic.com>
davidgonzalez-nr pushed a commit that referenced this pull request Jun 23, 2026
… environment (newrelic#2942)

The relationship-synthesis validator (validator/tools/validate_relationship_synthesis_rules.js)
gathers every `.yml` file under `relationships/synthesis/` into a single
flat list and checks `name` uniqueness against one global Map. That doesn't
match the runtime semantics documented in README.md:

> `.stg` file will replace original in STG while original will be used for
> PRODUCTION

So `INFRA_X-to-Y.yml` and `INFRA_X-to-Y.stg.yml` never co-exist in any
deployed environment, yet the validator treats them as if they did. This
forces authors to suffix override identifiers (e.g. `mySuperRule -> mySuperRuleStgOverride`)
purely to satisfy CI, even when the override's intent is to *be* the same
rule with one specific change for staging — and creates a needless rename
on every promotion.

This change introduces a new helper, `getRelationshipSynthesisDefinitionsByEnvironment`,
that partitions definition files into the two file sets that load in each
environment (prod = non-.stg.yml; staging = .stg.yml override if present
otherwise the .yml). The validator now runs the existing per-rule checks
once per environment with its own name-uniqueness map. Cross-environment
collisions are no longer flagged; in-environment collisions still fail
(now with the env name in the error message for clarity).

Locally tested:
  - Same `name` across `INFRA_DOCKER_CONTAINER-to-EXT_SERVICE.yml` and
    `…stg.yml` (the override pair) → passes (was failing before).
  - Same `name` in two unrelated prod `.yml` files → still fails, with
    "in the production environment" suffix.
  - Same `name` in two unrelated `.stg.yml` files → still fails, with
    "in the staging environment" suffix.
  - All other rule-local checks (TTL, resolver count, condition/origin)
    are unchanged; they run once per environment but are idempotent.

The existing `getAllRelationshipSynthesisDefinitions` helper is preserved
for backward compatibility (no other callers in-tree, but kept to avoid
any external references breaking).

Followups not in this PR: README.md "Required validation step #2"
(`mySuperRule -> mySuperRuleStgOverride`) becomes optional rather than
required and should be revised. Backend systems that consume rule names
across both environments should be confirmed env-aware before this is
merged — `relationships.sourceTypeTarget.count` already facets by
`environment`, suggesting the data path is already segmented, but the
relationship-approver / synthesis service should be checked.
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.

1 participant