{"id":24383408,"url":"https://github.com/firstandthird/micro-metrics","last_synced_at":"2025-06-20T18:11:00.164Z","repository":{"id":57296455,"uuid":"57983188","full_name":"firstandthird/micro-metrics","owner":"firstandthird","description":"microservice metrics api","archived":false,"fork":false,"pushed_at":"2018-10-29T22:55:06.000Z","size":787,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-04T09:40:26.531Z","etag":null,"topics":["app"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firstandthird.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-03T16:14:20.000Z","updated_at":"2018-10-26T01:06:18.000Z","dependencies_parsed_at":"2022-09-07T03:21:05.477Z","dependency_job_id":null,"html_url":"https://github.com/firstandthird/micro-metrics","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fmicro-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fmicro-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fmicro-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fmicro-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstandthird","download_url":"https://codeload.github.com/firstandthird/micro-metrics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243258982,"owners_count":20262372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app"],"created_at":"2025-01-19T10:14:25.532Z","updated_at":"2025-03-12T17:20:33.438Z","avatar_url":"https://github.com/firstandthird.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# micro-metrics [![Build Status](https://travis-ci.org/firstandthird/micro-metrics.svg?branch=master)](https://travis-ci.org/firstandthird/micro-metrics) [![Coverage Status](https://coveralls.io/repos/github/firstandthird/micro-metrics/badge.svg?branch=master)](https://coveralls.io/github/firstandthird/micro-metrics?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/firstandthird/micro-metrics.svg)](https://greenkeeper.io/)\n## a microservice metrics api server using docker\n\n\n\n#### API Routes\n- **_/api/track_** (POST)\n\n  Create a new metric to track. Payload must be a JSON packet, can have the following params:\n   - **type** _(required)_ the name of the metric type you want to track\n   - **tags** an object in which the keys are the tag name and the values the associated value for that tag\n   - **value** the value of the metric. Can be any valid JSON type (string, number, object, array, etc). The default value is the number 1.\n   - **data** any data you want to store about this metric. Can be any JSON type.\n   - **userID** a string name indicating which user to associate this metric with\n\n   (see tests for examples)\n\n- **_/api/report?filter1=filter1value\u0026filter2=filter2value..._** (GET)\n\n   Search the tracked metrics to get a list of matching metrics. Filters can include any of the following:\n\n    - **type** retrieves all metrics of the indicated type\n    - **tags** a comma-separated list of tag queries. Each query can be either a tag name or a tag name=value pair. If just a tag name, it will retrieve all metrics with a tag of that name, regardless of the tag's value. If you pass a name=value pair, it will retrieve only the metrics with that tag name for which the value also matches.\n    - **startDate/endDate** a Javascript-parseable Date string, limiting the metrics returned by the maximum/minimum date of creation  \n    - **value** retrieve all metrics with the indicated value\n\n- **_/api/tags?filter1=filter1value\u0026filter2=filter2value..._** (GET)\n\n  Search the metric database for matching metrics, and return all tags names and a corresponding list of all values for that tag name for the matching metrics. Metric filters can be any field that was passed in the payload for _/api/track_. Result will be a JSON object like so:\n  ```\n  {\n    tagName1: ['tagValue1','tagValue2'],\n    tagName2: ['tagValue1', 'tagValue3', 'tagValue4']\n  }\n  ```\n\n- **_/api/types_** (GET)\n\nReturns a list of all the metric types in the database.\n\n\n#### Tracking Pixel\n\nTo track via tracking pixel, you can set an image into an app / email that you would like to track with the data appended as a query string.\n\n```\n\u003cimg src=\"/t.gif?type=pageview\u0026tags=tag1,tag2\u0026userId=99\" /\u003e\n```\n\nTo use tags with a `var` `val` notation, structure the tags portion of the string like this.\n\n```\ntags=var1=val1,var2=val2,var3=val3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstandthird%2Fmicro-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstandthird%2Fmicro-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstandthird%2Fmicro-metrics/lists"}