- Notifications
You must be signed in to change notification settings - Fork6
License
cloudfoundry/loggregator-api
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is the v2 API forLoggregator.
If you have any questions, or want to get attention for a PR or issue please reach out on the#logging-and-metrics channel in the cloudfoundry slack
| Field | Description |
|---|---|
| timestamp | UNIX timestamp in nanoseconds. |
| source_id | The source's ID of an envelope. (e.g.,984992f6-3cfb-4417-9321-786ee5233e9c for an app orcf/doppler for a doppler) |
| instance_id | The instance of a particular source (e.g., 1 for an app orede37607-52f0-4154-bb1b-4ae35212e126 for a doppler) |
| tags | key/value tags to include additional identifying information. (e.g.deployment=cf-warden) |
The meaning ofsource_id andinstance_id depend on the context of theirusage. There is either a Bosh-deployed instance group or a CF-pushedapplication. In the case of an instance group,source_id refers to a jobname, e.g., Doppler, andinstance_id refers to the particular instanceguid. In the case of a CF application, thesource_id refers to the app guid,and theinstance_id refers to the instance number of the application.
ALog is used to represent a simple text payload.
It represents whether the log is emitted to STDOUT or STDERR.
ACounter is used to represent a metric that only increases in value (e.g.metron.sentEnvelopes).
The emitter of a counter must set thedelta (anything else will bediscarded). It also provides the sum of all emitted values.
AGauge is used to represent a metric that can have arbitary numeric valuesthat increase or decrease.
It can be used emit a set of relatable metrics (e.g.memory{value=2048, unit=byte}, disk{value=4096, unit=byte}, cpu{value=2, unit=percentage})
ATimer is used to represent a metric that captures the duration of anevent. (e.g.databasePost)
AnEvent is used to represent data related to an asynchronous event that occured.
The properties in a v1 envelope can be obtained from a v2 envelope using thefollowing mappings:
Note previous versions of the Loggregator API automatically added tags toenvelopes for things likedeployment,job, andindex. This functionalityhas been removed in the v2 API. Users should manually add whatever tags theyrequire.
When envelopes went from the v1 to the v2 format, tags changed from a typed format, to being strings in all cases. When recieving envelopes from V2, to get the string formatted tagsUsePreferredTags should be used on the egress request. If this flag is not used, the v1 tags will be stored indeprecated_tags rather thentags, and will be formatted asloggregator_v2.Value rather then strings. You should not use this tag if you want to use the v1 conversion function.
| v1 | v2 |
|---|---|
| timestamp | envelope.timestamp |
| tags | envelope.tags |
| origin | envelope.tags['origin'].text |
| deployment | envelope.tags['deployment'].text |
| job | envelope.tags['job'].text |
| index | envelope.tags['index'].text |
| ip | envelope.tags['ip'].text |
AnHttpStartStop envelope is derived from a v2Timer envelope.
| v1 | v2 |
|---|---|
| startTimestamp | timer.start |
| stopTimestamp | timer.stop |
| applicationId | envelope.source_id |
| requestId | envelope.tags['request_id'].text |
| peerType | envelope.tags['peer_type'].text |
| method | envelope.tags['method'].text |
| uri | envelope.tags['uri'].text |
| remoteAddress | envelope.tags['remote_address'].text |
| userAgent | envelope.tags['user_agent'].text |
| statusCode | envelope.tags['status_code'].integer |
| contentLength | envelope.tags['content_length'].integer |
| instanceIndex | envelope.tags['instance_index'].integer |
| forwarded | envelope.tags['forwarded'].text |
ALogMessage envelope is derived from a v2Log envelope
| v1 | v2 |
|---|---|
| message | log.payload |
| message_type | log.type |
| timestamp | envelope.timestamp |
| app_id | envelope.source_id |
| source_type | envelope.tags['source_type'].text |
| source_instance | envelope.instance_id |
ACounterEvent envelope is derived from a v2Counter envelope
| v1 | v2 |
|---|---|
| name | counter.name |
| delta | counter.delta |
| total | counter.total |
One or moreValueMetric envelopes are derived from a v2Gauge envelope. Eachmetric key/value in aGauge envelope will become a singleValueMetricenvelope.
| v1 | v2 |
|---|---|
| name | key |
| value | gauge.metrics[key].value |
| unit | gauge.metrics[key].unit |
AContainerMetric envelope is derived from a v2Gauge envelope if and onlyif there are the correct gauge keys.
| v1 | v2 |
|---|---|
| applicationId | envelope.source_id |
| instanceIndex | envelope.instance_id |
| cpuPercentage | gauge.metrics['cpu'].value |
| memoryBytes | gauge.metrics['memory'].value |
| diskBytes | gauge.metrics['disk'].value |
| memoryBytesQuota | gauge.metrics['memory_quota'].value |
| diskBytesQuota | gauge.metrics['disk_quota'].value |
go-loggregator is a client library that consumes the v2 APIto make it easier to create a client and connect to Loggregator to obtain logsand metrics.
About
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.