newrelic / newrelic/newrelic-python-agent

Support for timestamp attribute in `record_custom_event` API

Open
#848 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Python
Stars
210
Forks
137
Avg merge
4d 19h
Merged PRs (30d)
12

Description

Is your feature request related to a problem? Please describe.

We publish custom events to new-relic using its record_custom_event API present in python agent and use nrql to create dashboards from those events. Requests processed by our applications are mostly async and we want to create dashboards to typical app metrics like traffic, latency, failure_rate, requests_stuck_until_last_x_mins etc.

The problem is these metrics are published at different timestamps which leads to formation of incorrect hypothesis when looking at a holistic dashboard. While we do publish a custom_timestamp field as well in our events, the plotting of events can only be done via timestamp field. We want an ability to pass a timestamp field in record_custom_event API for python agent so that we can keep all our events related to a single request in sync.

Feature Description

Update record_custom_event API signature to provide support for timestamp

record_custom_event(
                event_type,
                params,
                application,
                timestamp
            )
Describe Alternatives

We could've used simple event API that provides but then would have to re-write the entire logic of publishing events to NR. I see the python agent lib has a nice way of collecting sampled events and publishing them and we want to avoid re-inventing the wheel.

Additional context

None

Priority

Really Want

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Python agent's record_custom_event entry point and reading its current API contract. Determine how a supplied timestamp should be handled, then verify the completed behavior with tests showing related events retain the requested timestamp.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
analytics, api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.