{"id":16962729,"url":"https://github.com/sgoudham/micronaut-trace","last_synced_at":"2025-04-11T22:12:51.736Z","repository":{"id":65509332,"uuid":"588814157","full_name":"sgoudham/micronaut-trace","owner":"sgoudham","description":" Java annotation library to trace and time your method executions, written using Micronaut","archived":false,"fork":false,"pushed_at":"2023-01-15T09:00:07.000Z","size":90,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T22:12:48.117Z","etag":null,"topics":["annotation-processing","compile-time-annotation","java","library","micronaut","tracing"],"latest_commit_sha":null,"homepage":"https://search.maven.org/artifact/me.goudham/micronaut-trace","language":"Java","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/sgoudham.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":"2023-01-14T05:01:51.000Z","updated_at":"2023-01-31T23:31:45.000Z","dependencies_parsed_at":"2023-02-09T21:45:56.099Z","dependency_job_id":null,"html_url":"https://github.com/sgoudham/micronaut-trace","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgoudham%2Fmicronaut-trace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgoudham%2Fmicronaut-trace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgoudham%2Fmicronaut-trace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgoudham%2Fmicronaut-trace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgoudham","download_url":"https://codeload.github.com/sgoudham/micronaut-trace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487684,"owners_count":21112190,"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":["annotation-processing","compile-time-annotation","java","library","micronaut","tracing"],"created_at":"2024-10-13T23:07:42.749Z","updated_at":"2025-04-11T22:12:51.712Z","avatar_url":"https://github.com/sgoudham.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/sgoudham/micronaut-trace/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/sgoudham/micronaut-trace?colorA=363a4f\u0026colorB=b7bdf8\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/sgoudham/micronaut-trace/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/sgoudham/micronaut-trace?colorA=363a4f\u0026colorB=f5a97f\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/sgoudham/micronaut-trace/contributors\"\u003e\u003cimg src=\"https://img.shields.io/github/contributors/sgoudham/micronaut-trace?colorA=363a4f\u0026colorB=a6da95\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://search.maven.org/artifact/me.goudham/micronaut-trace\"\u003e\u003cimg src=\"https://img.shields.io/maven-central/v/me.goudham/micronaut-trace?colorA=363a4f\u0026colorB=a6da95\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\n# micronaut-trace\n\n\u003e Java annotation library to trace and time your method executions, written using [Micronaut](https://micronaut.io/).\n\n## Installation\n\nBe sure to replace the **VERSION** key below with the version shown above!\n\n### Maven\n\n```xml\n\u003c!-- https://mvnrepository.com/artifact/me.goudham/micronaut-trace --\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eme.goudham\u003c/groupId\u003e\n    \u003cartifactId\u003emicronaut-trace\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n    \u003c!-- If you want the .jar with all dependencies! WARNING: This might fix OR introduce various problems with Micronaut\n    \u003cclassifier\u003eshaded\u003c/classifier\u003e\n    --\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```gradle\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    // https://mvnrepository.com/artifact/me.goudham/micronaut-trace\n    implementation 'me.goudham:micronaut-trace:VERSION'\n    \n    // If you want the .jar with all dependencies! WARNING: This might fix OR introduce various problems with Micronaut\n    implementation 'me.goudham:micronaut-trace:VERSION:shaded'\n}\n```\n\n### Binaries\n\nIf you choose not to use a build tool, pre-built `.jar` files are available with every\nsingle [release](https://github.com/sgoudham/micronaut-trace/releases).\n\n## Usage\n\nWith the following example code:\n\n`PrintService.java`\n\n```java\npackage com.example;\n\nimport jakarta.inject.Singleton;\nimport me.goudham.micronaut.trace.annotation.Time;\nimport me.goudham.micronaut.trace.annotation.Trace;\n\nimport static java.lang.Thread.sleep;\n\n@Singleton\npublic class PrintService {\n    public PrintService() {\n    }\n\n    @Trace\n    @Time\n    public void printHello() throws InterruptedException {\n        System.out.println(\"hello\");\n        printAfter5Seconds(\"hi\");\n    }\n\n    @Trace\n    @Time\n    public void printAfter5Seconds(String message) throws InterruptedException {\n        sleep(5000);\n        System.out.println(message);\n    }\n}\n```\n\n`Application.java`\n\n```java\npackage com.example;\n\nimport io.micronaut.context.ApplicationContext;\n\npublic class Application {\n    public static void main(String[] args) throws InterruptedException {\n        ApplicationContext applicationContext = ApplicationContext.run();\n        PrintService printService = applicationContext.getBean(PrintService.class);\n        printService.printHello();\n    }\n}\n```\n\nThe output would look like:\n\n```shell\n08:09:04.577 [main] TRACE com.example.PrintService - [ENTERING]: printHello()\nhello\n08:09:04.577 [main] TRACE i.m.aop.chain.InterceptorChain - Intercepted method [void printHiAfter5Seconds(String message)] invocation on target: com.example.$PrintService$Definition$Intercepted@4ef74c30\n08:09:04.577 [main] TRACE i.m.aop.chain.InterceptorChain - Proceeded to next interceptor [me.goudham.micronaut.trace.shared.TimeInterpreter@2438dcd] in chain for method invocation: void printHiAfter5Seconds(String message)\n08:09:04.577 [main] TRACE i.m.aop.chain.InterceptorChain - Proceeded to next interceptor [me.goudham.micronaut.trace.shared.TraceInterpreter@41f69e84] in chain for method invocation: void printHiAfter5Seconds(String message)\n08:09:04.581 [main] TRACE com.example.PrintService - [ENTERING]: printHiAfter5Seconds(java.lang.String message)\nhi\n08:09:09.582 [main] TRACE com.example.PrintService - [EXITING]: printHiAfter5Seconds(java.lang.String message)\n08:09:09.582 [main] TRACE com.example.PrintService - [EXECUTION_TIME]: Elapsed execution time for printHiAfter5Seconds(java.lang.String message) is 5004 milliseconds\n08:09:09.582 [main] TRACE com.example.PrintService - [EXITING]: printHello()\n08:09:09.582 [main] TRACE com.example.PrintService - [EXECUTION_TIME]: Elapsed execution time for printHello() is 5005 milliseconds\n```\n\n## Contributing\n\nThank you for your interest in Contributing! See the following text for more information on how to build and test the\nproject.\n\n### Development\n\nThis project was not intended to be feature-rich but rather a project to play about with the Micronaut framework and\nlearn more about annotation processing, defining custom annotations and deploying a Micronaut library.\n\nIt is highly recommended that you are familiar with the framework before trying to understand the code. You can find\nthe latest documentation [here](https://docs.micronaut.io/latest/guide/).\n\n#### Tooling\n\nThis project uses the build tool [Maven](https://maven.apache.org/) from the java ecosystem. It is *highly* recommended\nto develop using [Intellij IDEA](https://www.jetbrains.com/idea/) as it will allow you to take advantage of its\nintegration with maven tooling.\n\nA great 5-minute introduction to Maven can be\nfound [here](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html).\n\n#### Building\n\nThe project can be built with the following series of commands:\n\n1. Clone Repository\n\n    ```shell\n    git clone https://github.com/sgoudham/micronaut-trace.git\n    ```\n\n2. [Enable Annotation Processing](https://docs.micronaut.io/latest/guide/#ideaSetup)\n\n3. Build \u0026 Package\n\n   ```shell\n   ./mvnw clean package\n   ```\n\n4. Run Tests\n\n   ```shell\n   ./mvnw test\n   ```\n\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgoudham%2Fmicronaut-trace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgoudham%2Fmicronaut-trace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgoudham%2Fmicronaut-trace/lists"}