{"id":13546862,"url":"https://github.com/addityasingh/graphql-lightstep-middleware","last_synced_at":"2026-01-14T18:21:52.478Z","repository":{"id":75354044,"uuid":"236236386","full_name":"addityasingh/graphql-lightstep-middleware","owner":"addityasingh","description":"GraphQL middleware to instrument resolvers with opentracing traces for lightstep collector","archived":false,"fork":false,"pushed_at":"2020-12-22T14:07:27.000Z","size":279,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T19:43:42.114Z","etag":null,"topics":["graphql","graphql-lightstep-middleware","graphql-middleware","lightstep","lightstep-collector","middleware","opentracing","opentracing-traces"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/addityasingh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":null,"patreon":"addityasingh","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-01-25T22:06:22.000Z","updated_at":"2022-01-24T06:36:55.000Z","dependencies_parsed_at":"2023-06-09T00:00:18.727Z","dependency_job_id":null,"html_url":"https://github.com/addityasingh/graphql-lightstep-middleware","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/addityasingh/graphql-lightstep-middleware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fgraphql-lightstep-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fgraphql-lightstep-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fgraphql-lightstep-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fgraphql-lightstep-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/addityasingh","download_url":"https://codeload.github.com/addityasingh/graphql-lightstep-middleware/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addityasingh%2Fgraphql-lightstep-middleware/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28430525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["graphql","graphql-lightstep-middleware","graphql-middleware","lightstep","lightstep-collector","middleware","opentracing","opentracing-traces"],"created_at":"2024-08-01T12:00:46.506Z","updated_at":"2026-01-14T18:21:52.459Z","avatar_url":"https://github.com/addityasingh.png","language":"TypeScript","funding_links":["https://patreon.com/addityasingh"],"categories":["Libraries"],"sub_categories":["JavaScript Libraries"],"readme":"# graphql-lightstep-middleware\n\n[![NPM](https://nodei.co/npm/graphql-lightstep-middleware.png)](https://npmjs.org/package/graphql-lightstep-middleware)\n\nGraphQL middleware to instrument and augment resolvers with opentracing traces for lightstep collector\n\n![build](https://github.com/addityasingh/graphql-lightstep-middleware/workflows/build/badge.svg)\n[![downloads](https://img.shields.io/npm/dt/graphql-lightstep-middleware.svg)](https://npmjs.org/package/graphql-lightstep-middleware?cacheSeconds=60)\n[![version](https://img.shields.io/npm/v/graphql-lightstep-middleware.svg)](https://npmjs.org/package/graphql-lightstep-middleware?cacheSeconds=3600)\n\n## Table of contents\n\n- [Getting started](#getting-started)\n- [API](#api)\n- [Contributing](#contributing)\n  - [Code of Conduct](#code-of-conduct)\n  - [Contributing](#contributing)\n  - [Good first issues](#good-first-issues)\n- [License](#licence)\n\n## Getting started\n\n1. Install the package and graphql-middleware\n\n```sh\nyarn add graphql-lightstep-middleware\nyarn add graphql-middleware\n```\n\n2. Create the lightstep global tracer\n\n```javascript\nimport { initGlobalTracer } from \"opentracing\";\nimport { Tracer as LightstepTracer } from \"lightstep-tracer\";\n\n// Initialise the lightstep tracer\ninitGlobalTracer(new LightstepTracer({\n  access_token: \"developer\",\n  component_name: \"graphql-lightstep-middleware\",\n  collector_host: \"localhost\",\n  collector_port: 8360,\n  plaintext: true,\n  collector_encryption: \"none\"\n} as any));\n```\n\n3. Configure the middleware\n\n```javascript\nimport graphqlLightstepMiddleware from \"graphql-lightstep-middleware\";\n\n// create the lightstep-graphql-middleware\nconst lightstepMiddleware = graphqlLightstepMiddleware({\n  tracer: globalTracer()\n});\n```\n\n4. Apply the middleware to the schema\n\n```javascript\nimport express from \"express\";\nimport graphqlExpressHttp from \"express-graphql\";\nimport { applyMiddleware } from \"graphql-middleware\";\nimport { makeExecutableSchema } from \"graphql-tools\";\n\n// Construct a schema, using GraphQL schema language\nconst typeDefs = `\n  type Query {\n    hello(name: String): String\n  }\n`;\n\nconst resolvers = {\n  Query: {\n    hello: (parent, args, context) =\u003e {\n      const result = `Hello ${args.name ? args.name : \"world\"}!`;\n      // The rootSpan is available in the context now\n      context.tracing.rootSpan.addTags({\n        helloResolver: result\n      });\n      return result;\n    }\n  }\n};\n\n// apply the middleware to the schema\nconst schema = applyMiddleware(\n  makeExecutableSchema({ typeDefs, resolvers }),\n  lightstepMiddleware\n);\n\n// Use the schema in your graphql server\nconst app = express();\napp.use(\n  \"/graphql\",\n  graphqlExpressHttp({\n    schema: schema,\n    rootValue: resolvers,\n    graphiql: true\n  })\n);\n```\n\n## API\n\n### middleware = graphqlLightstepMiddleware([options])\n\n- `options`\n  - `tracer`: An optional `lightstep` tracer object\n  - `hooks`: Lost of `PreResolve` and `PostResolve` hooks\n\nRefer the [examples](./examples) for more usage examples\n\n## Contributing\n\n`graphql-lightstep-middleware` package intends to support contribution and support and thanks the open source community to making it better. Read below to learn how you can improve this repository and package\n\n### Code of Conduct\n\nPlease check the [CODE OF CONDUCT](./CODE_OF_CONDUCT) which we have in place to ensure safe and supportive environment for contributors\n\n### Contributing\n\nFeel free to create issues and bugs in the issues section using issues and bugs template. Please also ensure that there are not existing issues created on the same topic\n\n### Good first issues\n\nPlease check issues labeled [#good-first-issues](https://github.com/addityasingh/graphql-lightstep-middleware/labels/good%20first%20issue) under the issues section\n\n## Licence\n\n`graphql-lightstep-middleware` uses [MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddityasingh%2Fgraphql-lightstep-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddityasingh%2Fgraphql-lightstep-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddityasingh%2Fgraphql-lightstep-middleware/lists"}