Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: add language identifiers
  • Loading branch information
brnhensley authored Jul 27, 2022
commit 1d350e48a6f3815546c87918bf1a22e766c6fdc0
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ When creating your own custom events and attributes, follow data requirements fo
>
Custom event collection is enabled by default in Java agent version 3.13.0 or higher. To send custom events, call [`recordCustomEvent`](https://newrelic.github.io/java-agent-api/javadoc/index.html?com/newrelic/api/agent/Insights.html). For example:

```
```java
Map<String, Object> eventAttributes = new HashMap<String, Object>();
NewRelic.getAgent().getInsights().recordCustomEvent("<var>MyCustomEvent</var>", <var>eventAttributes</var>);
NewRelic.getAgent().getInsights().recordCustomEvent("MyCustomEvent</var>", eventAttributes);
```

The first argument defines the name of your event type, and the second argument is a map with the attributes for your custom event. Event attributes must be strings or numbers. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see our documentation about [limits and restricted characters](/docs/telemetry-data-platform/custom-data/custom-events/data-requirements-limits-custom-event-data) and [NRQL reserved words](/docs/insights/event-data-sources/custom-events/data-requirements-limits-custom-event-data/#reserved-words).
Expand All @@ -87,14 +87,14 @@ When creating your own custom events and attributes, follow data requirements fo

Specify the maximum number of events to record per minute as an integer. For example, if you want to send less than the default of 10000 events:

```
```yml
custom_insights_events:
max_samples_stored: 5000
```

To disable custom events entirely, add the following to your `newrelic.yml`:

```
```yml
custom_insights_events:
enabled: false
```
Expand All @@ -103,7 +103,7 @@ When creating your own custom events and attributes, follow data requirements fo

For Java agent versions prior to 4.1.0, use the following YAML configuration:

```
```yml
custom_insights_events.enabled: true
custom_insights_events.max_samples_stored: 5000
```
Expand All @@ -116,7 +116,7 @@ When creating your own custom events and attributes, follow data requirements fo
>
Custom event collection is enabled by default in .NET agent version 4.6.29.0 or higher. To send custom events, simply call [`RecordCustomEvent()`](/docs/agents/net-agent/net-agent-api/recordcustomevent-net-agent). For example:

```
```cs
var eventAttributes = new Dictionary<String, Object>();
NewRelic.Api.Agent.NewRelic.RecordCustomEvent('MyCustomEvent', eventAttributes);
```
Expand All @@ -135,8 +135,8 @@ When creating your own custom events and attributes, follow data requirements fo
>
Custom event collection is enabled by default in Node.js agent version 1.15.0 or higher. To send custom events, simply call the relevant API. For example:

```
recordCustomEvent(<var>eventType</var>, <var>attributes</var>)
```js
recordCustomEvent(eventType, attributes)
```

Use recordCustomEvent to record an event-based metric, usually associated with a particular duration. The eventType must be an alphanumeric string less than 255 characters. The attributes must be an object of key and value pairs. The keys must be shorter than 255 characters, and the values must be string, number, or boolean. For restrictions on event type names, see our documentation about [limits and restricted characters](/docs/telemetry-data-platform/custom-data/custom-events/data-requirements-limits-custom-event-data) and [NRQL reserved words](/docs/insights/event-data-sources/custom-events/data-requirements-limits-custom-event-data/#reserved-words).
Expand All @@ -153,8 +153,8 @@ When creating your own custom events and attributes, follow data requirements fo
>
Custom event collection is enabled by default in PHP agent version 4.18 or higher. To send custom events, simply call the relevant API function. For example:

```
newrelic_record_custom_event("<var>WidgetSale</var>", array("<var>color</var>"=>"<var>red</var>", "<var>weight</var>"=><var>12.5</var>));
```php
newrelic_record_custom_event("WidgetSale", array("color"=>"red", "weight"=>12.5));
```

The first argument defines the name of your event type, and the second argument is an array with the attributes for your custom event. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see our documentation about [limits and restricted characters](/docs/telemetry-data-platform/custom-data/custom-events/data-requirements-limits-custom-event-data) and [NRQL reserved words](/docs/insights/event-data-sources/custom-events/data-requirements-limits-custom-event-data/#reserved-words).
Expand All @@ -173,8 +173,8 @@ When creating your own custom events and attributes, follow data requirements fo
>
Custom event collection is enabled by default in Python agent version 2.60.0.46 or higher. To send custom events, simply call the relevant API. For example:

```
newrelic.agent.<mark>record_custom_event</mark>(event_type, params, application=None)
```python
newrelic.agent.record_custom_event(event_type, params, application=None)
```

The `event_type` defines the name (or type) of the custom event. Attributes of the custom event should be passed in as a dictionary via the `params` keyword argument. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For limits and restrictions on `event_type` and `params`, see our documentation about [limits and restricted characters](/docs/telemetry-data-platform/custom-data/custom-events/apm-report-custom-events-attributes/) and [reserved words](/docs/insights/event-data-sources/custom-events/data-requirements-limits-custom-event-data/#reserved-words)
Expand All @@ -193,8 +193,8 @@ When creating your own custom events and attributes, follow data requirements fo
>
Custom event collection is enabled by default in Ruby agent version 3.9.8.273 or higher. To send custom events, simply call the relevant API. For example:

```
::NewRelic::Agent.record_custom_event('<var>WidgetSale</var>', <var>color</var>: '<var>red</var>', <var>weight</var>: <var>12.5</var>)
```ruby
::NewRelic::Agent.record_custom_event('WidgetSale', color: 'red', weight: 12.5)
```

The first argument defines the name of your event type, and the second argument is a hash with the attributes for your custom event. Ensure you limit the number of unique event type names that you create, and do not generate these names dynamically. For restrictions on event type names, see our documentation about [limits and restricted characters](/docs/telemetry-data-platform/custom-data/custom-events/data-requirements-limits-custom-event-data) and [NRQL reserved words](/docs/insights/event-data-sources/custom-events/data-requirements-limits-custom-event-data/#reserved-words).
Expand All @@ -204,7 +204,7 @@ When creating your own custom events and attributes, follow data requirements fo
1. Add [`custom_insights_events.max_samples_stored:`](/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration#custom_insights_events.max_samples_stored) to your configuration file.
2. Specify the maximum number of events to record per minute as an integer. For example, if you want to be able to send up to 5000 events per minute, add:

```
```yml
custom_insights_events.max_samples_stored: 5000
```

Expand Down