{"__v":3,"_id":"56735fc247f7010d005bfdd6","category":{"__v":5,"_id":"564514ff98da41190099f346","pages":["56451bbf98da41190099f352","56452bcc7f1fff210078e754","5645518cdecdee0d0090b786","56735fc247f7010d005bfdd6","5696fa4969393517000c8257"],"project":"5644e8bed608df0d00d269d9","version":"5644e8f22229d7170010923b","reference":false,"createdAt":"2015-11-12T22:38:55.104Z","from_sync":false,"order":3,"slug":"metric-data","title":"Metric Data"},"parentDoc":null,"project":"5644e8bed608df0d00d269d9","user":"5644e82bb360ea0d00914817","version":{"__v":15,"_id":"5644e8f22229d7170010923b","project":"5644e8bed608df0d00d269d9","createdAt":"2015-11-12T19:30:58.871Z","releaseDate":"2015-11-12T19:30:58.871Z","categories":["5644e8f32229d7170010923c","564514ff98da41190099f346","564523546b0ca50d00f6bdb8","564533dc6b0ca50d00f6bdcf","564535c16b0ca50d00f6bdd2","5645397a6b0ca50d00f6bddb","5645451eda14e70d0027cd2c","56454606decdee0d0090b774","564550e2bb7ad50d00e9c4ce","566f6768f11d5a0d007226e3","56a65b2f2ec8310d007bc1f2","56d77760693ef41d0003ac19","57151b8f11537f19006aab1e","5720e5dbdb52d01700f5d267","57487fd7db76422200d95873"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"updates":[],"createdAt":"2015-12-18T01:22:10.241Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"The following example shows how to send a backfill 4 data points for a counter type starting midnight, December 20th 2015 with a values 100, 200, 400, 300:\n\n$ SFX_TOKEN=\"YOUR API TOKEN\"\n$ curl \\\n --request POST \\\n --header \"X-SF-TOKEN: $SFX_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\"timestamp\":1450569600000, \"value\":100}\n {\"timestamp\":1450569610000, \"value\":200}\n {\"timestamp\":1450569620000, \"value\":400}\n {\"timestamp\":1450569630000, \"value\":300}' \\\n \"http://lab.corp.signalfx.com/v1/backfill?orgid=MY_ORG_ID&mydimension=myvalue&metric=MY_METRIC_NAME&metric_type=counter\"\n\n\"OK\"","language":"shell"}]},"results":{"codes":[{"name":"","code":"\"OK\"","language":"text","status":200}]},"settings":"5673511222cd7e0d00fad9c7","auth":"required","params":[{"_id":"5673646422cd7e0d00fad9e3","ref":"","required":false,"desc":"your organization ID.","default":"","type":"string","name":"orgid"},{"_id":"5673646422cd7e0d00fad9e2","ref":"","required":false,"desc":"the name of the metric being backfilled.","default":"","type":"string","name":"metric"},{"_id":"5673646422cd7e0d00fad9e1","ref":"","required":false,"desc":"replace DIMENSION_NAME with your dimension. The value should be the value of the dimension. Add one such parameter per dimension.","default":"","type":"string","name":"sfxdim_DIMENSION_NAME"},{"_id":"567892d6ade8221700923c0c","ref":"","required":false,"desc":"type of your metric. Can be gauge, counter or cumulative_counter.","default":"gauge","type":"string","name":"metric_type"}],"url":"/v1/backfill"},"isReference":false,"order":2,"body":"All the examples in this document are shown using the [httpie](https://github.com/jkbrzt/httpie) command-line utility, which provides very convenient interactions with JSON-based HTTP REST APIs\n\nIf you need to send historical data, SignalFx provides a distinct \"backfill\" API endpoint at https://backfill.signalfx.com/v1/backfill that allows for data points to be ingested into the system \"in the past\". This is in contrast to the the /datapoint endpoint which is designed to accept data points in a streaming manner, as they are generated, and expects the timestamps of the data points to be in monotonically increasing order (when they are specified)\n\nThis ability comes with certain requirements/best practices that the user must keep in mind to ensure the desired results are obtained.\n\n- A given backfill call may only target a single metric time series, addressed by its dimensions, its metric type and its metric name.\n\n- Within a given backfill call, data points must be sent in chronological order (for the same reasons the /datapoint endpoint only accepts data points in order).\n\n- A single backfill call must contain exact multiples of one hour of data points starting from the top of an hour (e.g. 7:00 AM to 8:00AM, 9:00PM to 3:00AM). It is recommended that each call contains a few thousand data points (e.g. 1 day or 1-min resolution points, or 1 hour of 1-sec resolution points).\n\n- Backfill calls should not contain significant gaps in the history of data being backfilled because they overwrite all existing data for the period being backfilled. If there is a need to backfill multiple disjoint periods of time, they should be backfilled through distinct API calls.\n\n- Backfill will overwrite any existing TSDB data. Derived metrics and the output of analytics in charts based on historical data that is being overwritten by a backfill call will not be recalculated with the new data.\n\nThe /backfill API endpoint supports the same ingest styles as the /datapoint endpoint with regard to content type (JSON and ProtocolBuffers) and the ability to stream multiple data points through the same HTTP POST request. Refer to the examples on Sending data points for the corresponding documentation.\n\nSpecify dimensions, metric type the metric as query parameters. For the metric, the query parameter is \"metric\". For any dimension XYZ, the query parameter is sfxdim_XYZ. For example, to backfill for the dimension \"host\", one would use the query parameter sfxdim_host. For metric type, the query parameter is metric_type. Just like for regular ingest the available metric types are gauge, counter and cumulative_counter. The metric type for a particular metric should not be changed across different calls to the backfill API. If the metric is already in our system we will use the metric type of the existing metric. If it is not present we will create the metric with the metric type you specify. If the metric_type query parameter is absent then it is assumed to be a gauge.\n\nWhen sending data points, make sure both the timestamp and the value are sent as numbers (and not as strings) for JSON encoded data, data points should each be represented as a JSON Object within braces '{ .. }' and successive values should be separated by space, NOT by comma.\n\nNote: orgid can be looked up from the /organization endpoint","excerpt":"","slug":"backfill","type":"post","title":"/backfill"}post/backfill
Definition
{{ api_url }}{{ page_api_url }}
Parameters
orgid:
string
your organization ID.
metric:
string
the name of the metric being backfilled.
sfxdim_DIMENSION_NAME:
string
replace DIMENSION_NAME with your dimension. The value should be the value of the dimension. Add one such parameter per dimension.
metric_type:
stringgauge
type of your metric. Can be gauge, counter or cumulative_counter.