• EnglishEspañol日本語한국어Português
  • Log inStart now

Agent API method pages

Syntax

newrelic.apiStyleGuidelines(data type $parameter_name[, integer $optional_param])
newrelic.apiStyleGuidelines(data type $parameter_name, array $different_param, string $third_param)

Briefly describe the call. Ideally, one line or less on the "View all methods" page.

Requirements

Agent version 1.2.3.4 or higher.

Additional requirements on their own line (do not use bullets).

Do not use any callouts.

If there are no special requirements, write: Compatible with all agent versions.

Description

Describe the behavior of the call with as much detail as possible. Do not describe what individual parameters do except in broad strokes; details of parameters and call variants belong under the Parameters heading. Similarly, do not describe return values.

When cross-referencing another API call, format its name with code blocks, and include parentheses () like this: anotherCoolMethod().

Tip

You can include callouts, but use discretion. These pages are already visually busy.

Parameters

If there are no parameters, leave this section blank. If there is only one call variant, do not include a syntax block in this section.

Parameter

Description

newrelic.apiStyleGuidelines(data type $parameter_name[, integer $optional_param])

$parameter_name

data type

Required. Brief description of parameter.

$optional_param

integer

Optional. Brief description of parameter.

newrelic.apiStyleGuidelines(data type $parameter_name, array $different_param)

$parameter_name

data type

Required. Brief description of parameter.

$different_param

array

Required. Brief description of parameter.

$third_param

string

Required. Brief description of parameter.

Return values

What does this call return, and in what circumstances? Are there any things we expect customers to do with that return value? If the call does not return anything, leave this section blank.

Examples

This section documents rules for oddballs that aren't self-documenting. The rest of the examples are embedded within the page itself. In general, this page is intended for style reference. For examples of how to write good API method pages, check out our existing API docs, such as the PHP API.

URL guidelines

For the doc's URL:

  • Manually edit the URL slug to remove the agent name.
  • Where the API call does not already include separators (as in newrelic_awesome_call), separate the bits with hyphens -.

For example:

https://docs.newrelic.com/docs/new-relic-only/advanced-style-guide/writing-guidelines/api-style-guidelines

Title guidelines

For the doc's title:

  • Include the method name and the agent name in parentheses.
  • Do not include newrelic. prefixes unless they are integral to the call name (as in the PHP agent).
  • Do not include parentheses () in the call itself.

For example:

apiStyleGuidelines (Example agent API)

Short title guidelines

For the doc's short title:

  • Include only the method name.
  • Do not include newrelic. prefixes unless they are integral to the call name (as in the PHP agent).
  • Do not include parentheses ().
  • Adjust if necessary to fit on a single line in the category's sidebar.

For example:

apiStyleGuidelines

Syntax guidelines

Important

The Python and iOS agents use their own guidelines. For those guidelines, see the existing methods in those languages.

  • Document each variant of a call on its own line.
  • Do not use any formatting except italicizing the data type.
  • Wrap optional parameters (including the comma separator) in square brackets [].
  • Indicate the variable portion by prefacing it with a dollar sign $.
  • If the call must be prefixed with newrelic. or similar, include that in the syntax.
  • Optional: Include the return value, if that seems important for your particular agent. If you do, follow language conventions.
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.