How to add field to custom event?

We have added a new field to one of our custom events. Somehow we don’t see the newly added field in NR. The code runs smooth and doesn’t complain about the new field but it isn’t visible in the NR UI. Do we have any documentation around editing custom events? Thanks in advance.

Introduction to the Event API | New Relic Documentation

How are you sending your custom event? Can you post the code (omitting your API key)?

We are creating the event objects first, then the event client and calling the ‘send_batch’ method.
Event(
event_type=EVENT_TYPE,
tags={}, timestamp_ms=
)
event_client = EventClient(get_nr_api_key())
response = event_client.send_batch(events_batch_to_send)
response.raise_for_status()

I don’t see any errors in the logs also.

Hi, @vsurabhi: It looks like you are using the Telemetry SDK. If you are having trouble with it, I recommend that you post an issue to the SDK’s github repo: https://github.com/newrelic/newrelic-telemetry-sdk-python.

Here is how I send a custom event in straight Python:

import json
import requests

headers = { 'X-Insert-Key': YOUR_INSERT_KEY }
url = 'https://insights-collector.newrelic.com/v1/accounts/' + YOUR_ACCOUNT_ID + '/events'

content = json.dumps({ 
  'eventType': EVENT_TYPE, 
  'attribute1': 'value1',
  'attribute2': 'value2'
})
response = requests.post(url, data = content, headers = headers)

Thank you Phil. For interested users, created this ticket in github Telemetry SDK.

2 Likes