NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA Telemetry Exporter
Collaboration diagram for DOCA Telemetry Exporter:

Modules

 DOCA Telemetry NetFlow
 

Macros

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_BOOL   "bool"
 DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_{} are data types that are used to create doca_telemetry_exporter_field;. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_CHAR   "char"
 DOCA telemetry char type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_SHORT   "short"
 DOCA telemetry short type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT   "int"
 DOCA telemetry in type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_LONG   "long"
 DOCA telemetry long type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_LONGLONG   "long long"
 DOCA telemetry longlong type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UCHAR   "unsigned char"
 DOCA telemetry uchar type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_USHORT   "unsigned short"
 DOCA telemetry ushort type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT   "unsigned int"
 DOCA telemetry uint type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_ULONG   "unsigned long"
 DOCA telemetry ulong type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_ULONGLONG   "unsigned long long"
 DOCA telemetry ulonglong type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_FLOAT   "float"
 DOCA telemetry float type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_DOUBLE   "double"
 DOCA telemetry double type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT8   "int8_t"
 DOCA telemetry int8 type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT16   "int16_t"
 DOCA telemetry int16 type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT32   "int32_t"
 DOCA telemetry int32 type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT64   "int64_t"
 DOCA telemetry int64 type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT8   "uint8_t"
 DOCA telemetry uint8 type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT16   "uint16_t"
 DOCA telemetry uint16 type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT32   "uint32_t"
 DOCA telemetry uint32 type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT64   "uint64_t"
 DOCA telemetry uint64 type. More...
 
#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_TIMESTAMP   DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT64
 DOCA telemetry timestamp type. More...
 
#define DOCA_GUID_SIZE   16
 DOCA GUID size. More...
 

Typedefs

typedef enum doca_telemetry_exporter_ipc_status doca_telemetry_exporter_ipc_status_t
 DOCA telemetry IPC status. More...
 
typedef uint8_t doca_telemetry_exporter_type_index_t
 DOCA schema field type index. More...
 
typedef uint64_t doca_telemetry_exporter_timestamp_t
 DOCA schema type index type. More...
 
typedef uint8_t doca_guid_t[DOCA_GUID_SIZE]
 DOCA GUID type. More...
 

Enumerations

enum  doca_telemetry_exporter_ipc_status { DOCA_TELEMETRY_EXPORTER_IPC_STATUS_FAILED = -1 , DOCA_TELEMETRY_EXPORTER_IPC_STATUS_CONNECTED , DOCA_TELEMETRY_EXPORTER_IPC_STATUS_DISABLED }
 DOCA telemetry IPC status. More...
 

Functions

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_init (const char *schema_name, struct doca_telemetry_exporter_schema **doca_schema)
 Initialize DOCA schema to prepare it for setting attributes and adding types. DOCA schema is used to initialize DOCA sources that will collect the data according to the same schema. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_buf_size (struct doca_telemetry_exporter_schema *doca_schema, uint64_t size)
 Set buffer size Default value is 60000 bytes. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_buf_size (struct doca_telemetry_exporter_schema *doca_schema, uint64_t *size)
 Get buffer size. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_buf_data_root (struct doca_telemetry_exporter_schema *doca_schema, const char *path)
 Set buffer data root Default path is "/opt/mellanox/doca/services/telemetry/data/". More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_buf_data_root (struct doca_telemetry_exporter_schema *doca_schema, const char **path)
 Get data root path. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_file_write_enabled (struct doca_telemetry_exporter_schema *doca_schema)
 Enable file write file write is disabled by default. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_file_write_max_size (struct doca_telemetry_exporter_schema *doca_schema, size_t size)
 Set file maximum size Default value is 1MB. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_file_write_max_size (struct doca_telemetry_exporter_schema *doca_schema, size_t *size)
 Get file maximum size. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_file_write_max_age (struct doca_telemetry_exporter_schema *doca_schema, doca_telemetry_exporter_timestamp_t max_age)
 Set file maximum age Default value is 1 hour. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_file_write_max_age (struct doca_telemetry_exporter_schema *doca_schema, doca_telemetry_exporter_timestamp_t *max_age)
 Get file maximum age. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_enabled (struct doca_telemetry_exporter_schema *doca_schema)
 Enable IPC IPC is disabled by default. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_sockets_dir (struct doca_telemetry_exporter_schema *doca_schema, const char *sockets_dir)
 Set IPC socket directory. Default path is "/opt/mellanox/doca/services/telemetry/ipc_sockets". More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_ipc_sockets_dir (struct doca_telemetry_exporter_schema *doca_schema, const char **sockets_dir)
 Get IPC socket directory. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_reconnect_time (struct doca_telemetry_exporter_schema *doca_schema, uint32_t max_time)
 Set IPC reconnect time in milliseconds Time limit for reconnect attempts. If the limit is reached, the client is considered disconnected. Default value is 100 milliseconds. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_ipc_reconnect_time (struct doca_telemetry_exporter_schema *doca_schema, uint32_t *max_time)
 Get IPC reconnect time in milliseconds. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_reconnect_tries (struct doca_telemetry_exporter_schema *doca_schema, uint8_t tries)
 Set maximum IPC reconnect tries. Number of reconnect attempts during reconnection period. Default value is 3 tries. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_ipc_reconnect_tries (struct doca_telemetry_exporter_schema *doca_schema, uint8_t *tries)
 Get maximum IPC reconnect tries. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_socket_timeout (struct doca_telemetry_exporter_schema *doca_schema, uint32_t timeout)
 Set IPC socket timeout in milliseconds Timeout for IPC messaging socket. If timeout is reached during send_receive, the client is considered disconnected. Default value is 3000 milliseconds. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_ipc_socket_timeout (struct doca_telemetry_exporter_schema *doca_schema, uint32_t *timeout)
 Get IPC socket timeout in milliseconds. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_opaque_events_enabled (struct doca_telemetry_exporter_schema *doca_schema)
 Enable opaque events Opaque events are disabled by default. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_type_create (struct doca_telemetry_exporter_type **type)
 Create new telemetry type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_type_add_field (struct doca_telemetry_exporter_type *type, struct doca_telemetry_exporter_field *field)
 Add DOCA telemetry field to type. The users loses the ownership of the field after a successful invocation of the function. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_type_destroy (struct doca_telemetry_exporter_type *type)
 Destroy doca telemetry type previously created by doca_telemetry_exporter_type_create() More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_field_create (struct doca_telemetry_exporter_field **field)
 Create new telemetry field. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_field_destroy (struct doca_telemetry_exporter_field *field)
 Destroy field previously created by doca_telemetry_exporter_field_create() More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_field_set_name (struct doca_telemetry_exporter_field *field_info, const char *name)
 Set doca telemetry field name. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_field_set_description (struct doca_telemetry_exporter_field *field_info, const char *desc)
 Set doca telemetry field description. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_field_set_type_name (struct doca_telemetry_exporter_field *field_info, const char *type)
 Set doca telemetry field type. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_field_set_array_len (struct doca_telemetry_exporter_field *field_info, uint16_t len)
 Set doca telemetry field length. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_add_type (struct doca_telemetry_exporter_schema *doca_schema, const char *new_type_name, struct doca_telemetry_exporter_type *type, doca_telemetry_exporter_type_index_t *type_index)
 Add user-defined fields to create new type in DOCA schema. The users loses the ownership of the type after a successful invocation of the function. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_destroy (struct doca_telemetry_exporter_schema *doca_schema)
 Destructor for DOCA schema. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_start (struct doca_telemetry_exporter_schema *doca_schema)
 Finalizes schema setup to start creating Doca Sources from the schema. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_create (struct doca_telemetry_exporter_schema *doca_schema, struct doca_telemetry_exporter_source **doca_source)
 Creates a single DOCA source from schema. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_source_set_id (struct doca_telemetry_exporter_source *doca_source, const char *source_id)
 Set source id. More...
 
DOCA_EXPERIMENTAL void doca_telemetry_exporter_source_set_tag (struct doca_telemetry_exporter_source *doca_source, const char *source_tag)
 Set source tag. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_start (struct doca_telemetry_exporter_source *doca_source)
 Applies source attribute and starts DOCA source. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_report (struct doca_telemetry_exporter_source *doca_source, doca_telemetry_exporter_type_index_t index, void *data, int count)
 Report events data of the same type via DOCA source. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_opaque_report (struct doca_telemetry_exporter_source *doca_source, const doca_guid_t app_id, uint64_t user_defined1, uint64_t user_defined2, const void *data, uint32_t data_size)
 Report opaque event data via DOCA source. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_get_opaque_report_max_data_size (struct doca_telemetry_exporter_source *doca_source, uint32_t *max_data_size)
 Get max data size for opaque report. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_flush (struct doca_telemetry_exporter_source *doca_source)
 Immediately flush the data of the DOCA source. This function is not thread-safe and should not be called from different threads without proper access control. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_destroy (struct doca_telemetry_exporter_source *doca_source)
 Destructor for DOCA source. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_get_timestamp (doca_telemetry_exporter_timestamp_t *timestamp)
 Get timestamp in the proper format. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_check_ipc_status (struct doca_telemetry_exporter_source *doca_source, doca_telemetry_exporter_ipc_status_t *status)
 Return status of IPC transport. More...
 

Detailed Description

DOCA lib for exporting events to the telemetry service.

Macro Definition Documentation

◆ DOCA_GUID_SIZE

#define DOCA_GUID_SIZE   16

DOCA GUID size.

Definition at line 128 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_BOOL

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_BOOL   "bool"

DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_{} are data types that are used to create doca_telemetry_exporter_field;.

DOCA telemetry bool type

Definition at line 83 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_CHAR

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_CHAR   "char"

DOCA telemetry char type.

Definition at line 85 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_DOUBLE

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_DOUBLE   "double"

DOCA telemetry double type.

Definition at line 107 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_FLOAT

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_FLOAT   "float"

DOCA telemetry float type.

Definition at line 105 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT   "int"

DOCA telemetry in type.

Definition at line 89 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT16

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT16   "int16_t"

DOCA telemetry int16 type.

Definition at line 111 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT32

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT32   "int32_t"

DOCA telemetry int32 type.

Definition at line 113 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT64

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT64   "int64_t"

DOCA telemetry int64 type.

Definition at line 115 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT8

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_INT8   "int8_t"

DOCA telemetry int8 type.

Definition at line 109 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_LONG

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_LONG   "long"

DOCA telemetry long type.

Definition at line 91 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_LONGLONG

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_LONGLONG   "long long"

DOCA telemetry longlong type.

Definition at line 93 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_SHORT

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_SHORT   "short"

DOCA telemetry short type.

Definition at line 87 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_TIMESTAMP

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_TIMESTAMP   DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT64

DOCA telemetry timestamp type.

Definition at line 125 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UCHAR

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UCHAR   "unsigned char"

DOCA telemetry uchar type.

Definition at line 95 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT   "unsigned int"

DOCA telemetry uint type.

Definition at line 99 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT16

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT16   "uint16_t"

DOCA telemetry uint16 type.

Definition at line 119 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT32

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT32   "uint32_t"

DOCA telemetry uint32 type.

Definition at line 121 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT64

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT64   "uint64_t"

DOCA telemetry uint64 type.

Definition at line 123 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT8

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_UINT8   "uint8_t"

DOCA telemetry uint8 type.

Definition at line 117 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_ULONG

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_ULONG   "unsigned long"

DOCA telemetry ulong type.

Definition at line 101 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_ULONGLONG

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_ULONGLONG   "unsigned long long"

DOCA telemetry ulonglong type.

Definition at line 103 of file doca_telemetry_exporter.h.

◆ DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_USHORT

#define DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_USHORT   "unsigned short"

DOCA telemetry ushort type.

Definition at line 97 of file doca_telemetry_exporter.h.

Typedef Documentation

◆ doca_guid_t

typedef uint8_t doca_guid_t[DOCA_GUID_SIZE]

DOCA GUID type.

Definition at line 132 of file doca_telemetry_exporter.h.

◆ doca_telemetry_exporter_ipc_status_t

◆ doca_telemetry_exporter_timestamp_t

DOCA schema type index type.

Definition at line 66 of file doca_telemetry_exporter.h.

◆ doca_telemetry_exporter_type_index_t

DOCA schema field type index.

Definition at line 61 of file doca_telemetry_exporter.h.

Enumeration Type Documentation

◆ doca_telemetry_exporter_ipc_status

DOCA telemetry IPC status.

Enumerator
DOCA_TELEMETRY_EXPORTER_IPC_STATUS_FAILED 
DOCA_TELEMETRY_EXPORTER_IPC_STATUS_CONNECTED 
DOCA_TELEMETRY_EXPORTER_IPC_STATUS_DISABLED 

Definition at line 40 of file doca_telemetry_exporter.h.

Function Documentation

◆ doca_telemetry_exporter_check_ipc_status()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_check_ipc_status ( struct doca_telemetry_exporter_source *  doca_source,
doca_telemetry_exporter_ipc_status_t status 
)

Return status of IPC transport.

Parameters
[in]doca_sourceInput doca source.
[out]statusif return is DOCA_SUCCESS then status can be one of the following
  • DOCA_TELEMETRY_EXPORTER_IPC_STATUS_FAILED - if IPC is not connected.
  • DOCA_TELEMETRY_EXPORTER_IPC_STATUS_CONNECTED - if IPC is connected.
  • DOCA_TELEMETRY_EXPORTER_IPC_STATUS_DISABLED - if IPC is disabled from config.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if doca_source is NULL.

◆ doca_telemetry_exporter_field_create()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_field_create ( struct doca_telemetry_exporter_field **  field)

Create new telemetry field.

Parameters
[out]fieldPointer to the newly allocated field.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.
  • DOCA_ERROR_NO_MEMORY - failed to allocate doca telemetry field.

◆ doca_telemetry_exporter_field_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_field_destroy ( struct doca_telemetry_exporter_field *  field)

Destroy field previously created by doca_telemetry_exporter_field_create()

Parameters
[in]fieldPointer to the field.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.

◆ doca_telemetry_exporter_field_set_array_len()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_field_set_array_len ( struct doca_telemetry_exporter_field *  field_info,
uint16_t  len 
)

Set doca telemetry field length.

Note
If using single-value type (i.e char) this should be 1.
Parameters
[in]field_infoPointer to doca telemetry field.
[in]lenField length.

◆ doca_telemetry_exporter_field_set_description()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_field_set_description ( struct doca_telemetry_exporter_field *  field_info,
const char *  desc 
)

Set doca telemetry field description.

Parameters
[in]field_infoPointer to doca telemetry field.
[in]descField description.
Note
Passing a field_info value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_field_set_name()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_field_set_name ( struct doca_telemetry_exporter_field *  field_info,
const char *  name 
)

Set doca telemetry field name.

Parameters
[in]field_infoPointer to doca telemetry field.
[in]nameField name.
Note
Passing a field_info value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_field_set_type_name()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_field_set_type_name ( struct doca_telemetry_exporter_field *  field_info,
const char *  type 
)

Set doca telemetry field type.

Note
Please see DOCA_TELEMETRY_EXPORTER_FIELD_TYPE_* for possible field types
Parameters
[in]field_infoPointer to doca telemetry field.
[in]typeField type.
Note
Passing a field_info value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_get_timestamp()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_get_timestamp ( doca_telemetry_exporter_timestamp_t timestamp)

Get timestamp in the proper format.

Parameters
[out]timestampTimestamp value
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if doca_source is NULL.

◆ doca_telemetry_exporter_schema_add_type()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_add_type ( struct doca_telemetry_exporter_schema *  doca_schema,
const char *  new_type_name,
struct doca_telemetry_exporter_type *  type,
doca_telemetry_exporter_type_index_t type_index 
)

Add user-defined fields to create new type in DOCA schema. The users loses the ownership of the type after a successful invocation of the function.

Parameters
[in]doca_schemaSchema to create type in.
[in]new_type_nameName for new type.
[in]typeUser-defined fields.
[out]type_indexType index for the created type is written to this variable.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - in case of memory allocation failure.
  • DOCA_ERROR_INVALID_VALUE - If type name exists or any of the fields have invalid field type

◆ doca_telemetry_exporter_schema_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_destroy ( struct doca_telemetry_exporter_schema *  doca_schema)

Destructor for DOCA schema.

Parameters
[in]doca_schemaSchema to destroy.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if doca_schema is NULL.

◆ doca_telemetry_exporter_schema_get_buf_data_root()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_buf_data_root ( struct doca_telemetry_exporter_schema *  doca_schema,
const char **  path 
)

Get data root path.

Parameters
[in]doca_schemaPointer to DOCA schema.
[out]pathPath to a folder where the data and schema will be stored.
Note
Ownership of the returned string is transferred to the caller.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.
  • DOCA_ERROR_NO_MEMORY - failed to allocate memory.

◆ doca_telemetry_exporter_schema_get_buf_size()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_buf_size ( struct doca_telemetry_exporter_schema *  doca_schema,
uint64_t *  size 
)

Get buffer size.

Parameters
[in]doca_schemaPointer to DOCA schema.
[out]sizeThe buffer size
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.

◆ doca_telemetry_exporter_schema_get_file_write_max_age()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_file_write_max_age ( struct doca_telemetry_exporter_schema *  doca_schema,
doca_telemetry_exporter_timestamp_t max_age 
)

Get file maximum age.

Parameters
[in]doca_schemaPointer to DOCA schema.
[out]max_ageMaximum file age. Once current file is older than this threshold a new file will be created.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.

◆ doca_telemetry_exporter_schema_get_file_write_max_size()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_file_write_max_size ( struct doca_telemetry_exporter_schema *  doca_schema,
size_t size 
)

Get file maximum size.

Parameters
[in]doca_schemaPointer to DOCA schema.
[out]sizeMaximum size of binary data file.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.

◆ doca_telemetry_exporter_schema_get_ipc_reconnect_time()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_ipc_reconnect_time ( struct doca_telemetry_exporter_schema *  doca_schema,
uint32_t *  max_time 
)

Get IPC reconnect time in milliseconds.

Parameters
[in]doca_schemaPointer to DOCA schema.
[out]max_timeMaximum reconnect time in milliseconds
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.

◆ doca_telemetry_exporter_schema_get_ipc_reconnect_tries()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_ipc_reconnect_tries ( struct doca_telemetry_exporter_schema *  doca_schema,
uint8_t *  tries 
)

Get maximum IPC reconnect tries.

Parameters
[in]doca_schemaPointer to DOCA schema.
[out]triesMaximum reconnect tries
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.

◆ doca_telemetry_exporter_schema_get_ipc_socket_timeout()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_ipc_socket_timeout ( struct doca_telemetry_exporter_schema *  doca_schema,
uint32_t *  timeout 
)

Get IPC socket timeout in milliseconds.

Parameters
[in]doca_schemaPointer to ipc timeout attribute.
[out]timeoutMaximum socket timeout in milliseconds
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.

◆ doca_telemetry_exporter_schema_get_ipc_sockets_dir()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_get_ipc_sockets_dir ( struct doca_telemetry_exporter_schema *  doca_schema,
const char **  sockets_dir 
)

Get IPC socket directory.

Parameters
[in]doca_schemaPointer to DOCA schema.
[out]sockets_dirPath to a folder containing DOCA Telemetry Service (DTS) sockets.
Note
Ownership of the returned string is transferred to the caller.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.
  • DOCA_ERROR_NO_MEMORY - failed to allocate memory.

◆ doca_telemetry_exporter_schema_init()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_init ( const char *  schema_name,
struct doca_telemetry_exporter_schema **  doca_schema 
)

Initialize DOCA schema to prepare it for setting attributes and adding types. DOCA schema is used to initialize DOCA sources that will collect the data according to the same schema.

Parameters
[in]schema_nameName of the schema.
[out]doca_schemaPointer to DOCA schema, NULL on error.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - failed to allocate doca_schema.
  • DOCA_ERROR_INITIALIZATION - failed to initialize doca_schema.
  • DOCA_ERROR_INVALID_VALUE - invalid input/output parameters.

◆ doca_telemetry_exporter_schema_set_buf_data_root()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_buf_data_root ( struct doca_telemetry_exporter_schema *  doca_schema,
const char *  path 
)

Set buffer data root Default path is "/opt/mellanox/doca/services/telemetry/data/".

Parameters
[in]doca_schemaPointer to DOCA schema.
[in]pathPath to a folder where the data and schema will be stored.
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_buf_size()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_buf_size ( struct doca_telemetry_exporter_schema *  doca_schema,
uint64_t  size 
)

Set buffer size Default value is 60000 bytes.

Parameters
[in]doca_schemaPointer to DOCA schema.
[in]sizeBuffer size
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_file_write_enabled()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_file_write_enabled ( struct doca_telemetry_exporter_schema *  doca_schema)

Enable file write file write is disabled by default.

Parameters
[in]doca_schemaPointer to DOCA schema.
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_file_write_max_age()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_file_write_max_age ( struct doca_telemetry_exporter_schema *  doca_schema,
doca_telemetry_exporter_timestamp_t  max_age 
)

Set file maximum age Default value is 1 hour.

Parameters
[in]doca_schemaPointer to DOCA schema.
[in]max_ageMaximum file age. Once current file is older than this threshold a new file will be created.
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_file_write_max_size()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_file_write_max_size ( struct doca_telemetry_exporter_schema *  doca_schema,
size_t  size 
)

Set file maximum size Default value is 1MB.

Parameters
[in]doca_schemaPointer to DOCA schema.
[in]sizeMaximum size of binary data file. Once this size is reached, a new binary file will be created.
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_ipc_enabled()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_enabled ( struct doca_telemetry_exporter_schema *  doca_schema)

Enable IPC IPC is disabled by default.

Parameters
[in]doca_schemaPointer to DOCA schema.
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_ipc_reconnect_time()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_reconnect_time ( struct doca_telemetry_exporter_schema *  doca_schema,
uint32_t  max_time 
)

Set IPC reconnect time in milliseconds Time limit for reconnect attempts. If the limit is reached, the client is considered disconnected. Default value is 100 milliseconds.

Parameters
[in]doca_schemaPointer to DOCA schema.
[in]max_timeMaximum reconnect time in milliseconds
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_ipc_reconnect_tries()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_reconnect_tries ( struct doca_telemetry_exporter_schema *  doca_schema,
uint8_t  tries 
)

Set maximum IPC reconnect tries. Number of reconnect attempts during reconnection period. Default value is 3 tries.

Parameters
[in]doca_schemaPointer to DOCA schema.
[in]triesMaximum reconnect tries
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_ipc_socket_timeout()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_socket_timeout ( struct doca_telemetry_exporter_schema *  doca_schema,
uint32_t  timeout 
)

Set IPC socket timeout in milliseconds Timeout for IPC messaging socket. If timeout is reached during send_receive, the client is considered disconnected. Default value is 3000 milliseconds.

Parameters
[in]doca_schemaPointer to ipc timeout attribute.
[in]timeoutMaximum socket timeout in milliseconds
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_ipc_sockets_dir()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_ipc_sockets_dir ( struct doca_telemetry_exporter_schema *  doca_schema,
const char *  sockets_dir 
)

Set IPC socket directory. Default path is "/opt/mellanox/doca/services/telemetry/ipc_sockets".

Parameters
[in]doca_schemaPointer to DOCA schema.
[in]sockets_dirPath to a folder containing DOCA Telemetry Service (DTS) sockets.
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_set_opaque_events_enabled()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_schema_set_opaque_events_enabled ( struct doca_telemetry_exporter_schema *  doca_schema)

Enable opaque events Opaque events are disabled by default.

Parameters
[in]doca_schemaPointer to DOCA schema.
Note
Passing a doca_schema value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_schema_start()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_schema_start ( struct doca_telemetry_exporter_schema *  doca_schema)

Finalizes schema setup to start creating Doca Sources from the schema.

Do NOT add new types after this function was called.

Parameters
[in]doca_schemaInput schema to start.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INITIALIZATION - in case of failure.

◆ doca_telemetry_exporter_source_create()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_create ( struct doca_telemetry_exporter_schema *  doca_schema,
struct doca_telemetry_exporter_source **  doca_source 
)

Creates a single DOCA source from schema.

To create a DOCA source, first call doca_telemetry_exporter_schema_start() to prepare the DOCA schema.

Parameters
[in]doca_schemaSchema from which source will be created.
[out]doca_sourcepointer to DOCA source, or NULL on error.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - in case of memory allocation failure.

◆ doca_telemetry_exporter_source_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_destroy ( struct doca_telemetry_exporter_source *  doca_source)

Destructor for DOCA source.

Parameters
[in]doca_sourceSource to destroy.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if doca_source is NULL.

◆ doca_telemetry_exporter_source_flush()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_flush ( struct doca_telemetry_exporter_source *  doca_source)

Immediately flush the data of the DOCA source. This function is not thread-safe and should not be called from different threads without proper access control.

Parameters
[in]doca_sourceDOCA source to flush.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if doca_source is NULL.

◆ doca_telemetry_exporter_source_get_opaque_report_max_data_size()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_get_opaque_report_max_data_size ( struct doca_telemetry_exporter_source *  doca_source,
uint32_t *  max_data_size 
)

Get max data size for opaque report.

Parameters
[in]doca_sourceSource to report.
[out]max_data_sizeMaximal data size
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter(s).

◆ doca_telemetry_exporter_source_opaque_report()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_opaque_report ( struct doca_telemetry_exporter_source *  doca_source,
const doca_guid_t  app_id,
uint64_t  user_defined1,
uint64_t  user_defined2,
const void *  data,
uint32_t  data_size 
)

Report opaque event data via DOCA source.

Data is flushed from internal buffer when the buffer is full. Flushing the data immediately can be done by invoking doca_telemetry_exporter_source_flush().

Parameters
[in]doca_sourceSource to report.
[in]app_idUser defined application ID.
[in]user_defined1User defined parameter 1.
[in]user_defined2User defined parameter 2.
[in]dataData buffer.
[in]data_sizeSize of the data in the data buffer.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - in case of memory allocation failure.

◆ doca_telemetry_exporter_source_report()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_report ( struct doca_telemetry_exporter_source *  doca_source,
doca_telemetry_exporter_type_index_t  index,
void *  data,
int  count 
)

Report events data of the same type via DOCA source.

Data is flushed from internal buffer when the buffer is full. Flushing the data immediately can be done by invoking doca_telemetry_exporter_source_flush(). This function is not thread-safe and should not be called from different threads without proper access control.

Parameters
[in]doca_sourceSource to report.
[in]indexType index in the DOCA schema.
[in]dataData buffer.
[in]countNumber of events written to the data buffer.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - in case of memory allocation failure.

◆ doca_telemetry_exporter_source_set_id()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_source_set_id ( struct doca_telemetry_exporter_source *  doca_source,
const char *  source_id 
)

Set source id.

Parameters
[in]doca_sourcePointer to DOCA source.
[in]source_idHostname or guid.
Note
Passing a doca_source value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_source_set_tag()

DOCA_EXPERIMENTAL void doca_telemetry_exporter_source_set_tag ( struct doca_telemetry_exporter_source *  doca_source,
const char *  source_tag 
)

Set source tag.

Parameters
[in]doca_sourcePointer to DOCA source.
[in]source_tagUser defined data-file name prefix.
Note
Passing a doca_source value of NULL will result in an undefined behavior.

◆ doca_telemetry_exporter_source_start()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_start ( struct doca_telemetry_exporter_source *  doca_source)

Applies source attribute and starts DOCA source.

Call this function to start reporting.

Parameters
[in]doca_sourceDOCA source to start.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if source attributes are not set.
  • DOCA_ERROR_NO_MEMORY - in case of memory allocation failure.

◆ doca_telemetry_exporter_type_add_field()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_type_add_field ( struct doca_telemetry_exporter_type *  type,
struct doca_telemetry_exporter_field *  field 
)

Add DOCA telemetry field to type. The users loses the ownership of the field after a successful invocation of the function.

Note
field should NOT be passed to another type after calling this function.
Parameters
[out]typePointer to doca telemetry type.
[out]fieldDOCA Telemetry field to add.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.
  • DOCA_ERROR_NO_MEMORY - failed to allocate doca telemetry field.

◆ doca_telemetry_exporter_type_create()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_type_create ( struct doca_telemetry_exporter_type **  type)

Create new telemetry type.

Parameters
[out]typePointer to the newly allocated type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.
  • DOCA_ERROR_NO_MEMORY - failed to allocate doca telemetry field.

◆ doca_telemetry_exporter_type_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_type_destroy ( struct doca_telemetry_exporter_type *  type)

Destroy doca telemetry type previously created by doca_telemetry_exporter_type_create()

Parameters
[in]typePointer to type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - NULL parameter.
Note
fields added to this type should NOT be used after calling this function.