Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

cloudfoundry/loggregator-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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

Table of Contents

v2 Envelope

FieldDescription
timestampUNIX timestamp in nanoseconds.
source_idThe source's ID of an envelope. (e.g.,984992f6-3cfb-4417-9321-786ee5233e9c for an app orcf/doppler for a doppler)
instance_idThe instance of a particular source (e.g., 1 for an app orede37607-52f0-4154-bb1b-4ae35212e126 for a doppler)
tagskey/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.

v2 Envelope Types

Log

ALog is used to represent a simple text payload.

It represents whether the log is emitted to STDOUT or STDERR.

Counter

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.

Gauge

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})

Timer

ATimer is used to represent a metric that captures the duration of anevent. (e.g.databasePost)

Event

AnEvent is used to represent data related to an asynchronous event that occured.


v2 -> v1 Mapping

The properties in a v1 envelope can be obtained from a v2 envelope using thefollowing mappings:

Tags

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.

Preferred Tags

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.

Envelope

v1v2
timestampenvelope.timestamp
tagsenvelope.tags
originenvelope.tags['origin'].text
deploymentenvelope.tags['deployment'].text
jobenvelope.tags['job'].text
indexenvelope.tags['index'].text
ipenvelope.tags['ip'].text

HttpStartStop

AnHttpStartStop envelope is derived from a v2Timer envelope.

v1v2
startTimestamptimer.start
stopTimestamptimer.stop
applicationIdenvelope.source_id
requestIdenvelope.tags['request_id'].text
peerTypeenvelope.tags['peer_type'].text
methodenvelope.tags['method'].text
urienvelope.tags['uri'].text
remoteAddressenvelope.tags['remote_address'].text
userAgentenvelope.tags['user_agent'].text
statusCodeenvelope.tags['status_code'].integer
contentLengthenvelope.tags['content_length'].integer
instanceIndexenvelope.tags['instance_index'].integer
forwardedenvelope.tags['forwarded'].text

LogMessage

ALogMessage envelope is derived from a v2Log envelope

v1v2
messagelog.payload
message_typelog.type
timestampenvelope.timestamp
app_idenvelope.source_id
source_typeenvelope.tags['source_type'].text
source_instanceenvelope.instance_id

CounterEvent

ACounterEvent envelope is derived from a v2Counter envelope

v1v2
namecounter.name
deltacounter.delta
totalcounter.total

ValueMetric

One or moreValueMetric envelopes are derived from a v2Gauge envelope. Eachmetric key/value in aGauge envelope will become a singleValueMetricenvelope.

v1v2
namekey
valuegauge.metrics[key].value
unitgauge.metrics[key].unit

ContainerMetric

AContainerMetric envelope is derived from a v2Gauge envelope if and onlyif there are the correct gauge keys.

v1v2
applicationIdenvelope.source_id
instanceIndexenvelope.instance_id
cpuPercentagegauge.metrics['cpu'].value
memoryBytesgauge.metrics['memory'].value
diskBytesgauge.metrics['disk'].value
memoryBytesQuotagauge.metrics['memory_quota'].value
diskBytesQuotagauge.metrics['disk_quota'].value

Client

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

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors16


[8]ページ先頭

©2009-2025 Movatter.jp