{"id":19653578,"url":"https://github.com/sematext/spm-tracing-api","last_synced_at":"2025-04-28T17:31:45.007Z","repository":{"id":34955414,"uuid":"39030642","full_name":"sematext/spm-tracing-api","owner":"sematext","description":"Java Tracing API for Performance Monitoring and Transaction Tracing via SPM","archived":false,"fork":false,"pushed_at":"2015-12-18T23:20:14.000Z","size":15,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":23,"default_branch":"master","last_synced_at":"2023-07-01T23:08:09.564Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://sematext.com/spm","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sematext.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-13T18:44:35.000Z","updated_at":"2018-03-14T02:38:46.000Z","dependencies_parsed_at":"2022-09-19T17:52:30.667Z","dependency_job_id":null,"html_url":"https://github.com/sematext/spm-tracing-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sematext%2Fspm-tracing-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sematext%2Fspm-tracing-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sematext%2Fspm-tracing-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sematext%2Fspm-tracing-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sematext","download_url":"https://codeload.github.com/sematext/spm-tracing-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224124775,"owners_count":17259746,"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":[],"created_at":"2024-11-11T15:14:33.617Z","updated_at":"2024-11-11T15:14:34.493Z","avatar_url":"https://github.com/sematext.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spm-tracing-api\nTracing API for JVM (Java, Scala, Clojure, Groovy, etc.) for [SPM Client](https://sematext.atlassian.net/wiki/display/PUBSPM/Transaction+Tracing).\n\n\nSPM Client has transaction tracing capability. This lets you get\ninsights about performance bottlenecks of an application. SPM\nClient uses bytecode instrumentation for tracing. To reduce runtime overhead tracing capabilities are targeted at specific\n[supported\nframeworks](https://sematext.atlassian.net/wiki/display/PUBSPM/Transaction+Tracing#TransactionTracing-SupportedTechnologies). To\nlet developers get more insights about performance bottlenecks in\n*their* code we provide an API to mark methods that should be included in\ntransaction traces, as well as setting custom parameters for such methods.\n\n## Usage\n\n### Add maven dependency\n\n    \u003cdependency\u003e\n    \t\u003cgroupId\u003ecom.sematext.spm\u003c/groupId\u003e\n    \t\u003cartifactId\u003espm-tracing-api\u003c/artifactId\u003e\n    \t\u003cversion\u003e1.29.4\u003c/version\u003e\n    \u003c/dependency\u003e\n\n### Mark traced methods\n\nTo mark methods that should be traced use `com.sematext.spm.client.tracing.Trace` annotation:\n\n    @Trace\n    public void createUser() {\n      ....\n      dao.createUser();\n    }\n\n\nIn this case `createUser()` method will be traced when it is called in an active transaction. To force transaction creation, `force` annotation parameter should be set to true (false by default):\n\n    @Trace(force = true)\n    public void doBackgroundJob() {\n      ...\n    }\n\n### Transaction level parameters\n\n`SPM.setTransactionName(\"customName\")` allows setting of a custom transaction name.  By default a transaction name is set to the name of the entry-point method.\n\n    SPM.setTransactionName(\"transaction-name-1\");\n\n![enter image description here](http://i.imgur.com/N3MFyx6.png)\n\n`SPM.setCustomTransactionParameter(\"key\", value\")` allows adding of a custom transaction parameter\n\n    SPM.setCustomTransactionParameter(\"random-seed\", \"731132938\");\n    SPM.setCustomTransactionParameter(\"user\", \"Kyle\");\n\n![enter image description here](http://i.imgur.com/zGbrnig.png)\n\nCalling `SPM.ignoreTransaction()` means the current transaction will not be traced. This can be useful if you want to ignore transactions depending on environment (dev/test), or for particular user/session, etc.\n\n### Method level parameters\n\n`SPM.setCustomMethodParameter(\"key-value\", \"key-value\")` allows adding of a custom parameter for currently traced method\n\n\t  @Trace\n\t  def getTweets(user: String): List[Tweet] = {\n\t    SPM.setCustomMethodParameter(\"user\", user)\n\t    TimeUnit.SECONDS.sleep(1)\n\t    Tweet(\"What a lovely day!\")::Nil\n\t  }\n\n![enter image description here](http://i.imgur.com/58OrB1x.png)\n\n\n## License\n\nCopyright 2015 Sematext Group, Inc.\n\nLicensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsematext%2Fspm-tracing-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsematext%2Fspm-tracing-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsematext%2Fspm-tracing-api/lists"}