{"id":16112450,"url":"https://github.com/serkan-ozal/stackwriter-serverless","last_synced_at":"2026-04-30T10:06:09.589Z","repository":{"id":151338302,"uuid":"493981761","full_name":"serkan-ozal/stackwriter-serverless","owner":"serkan-ozal","description":"StackWriter allows developers to be able to get, manipulate and send/report callstacks with local variables manually or automatically on error.","archived":false,"fork":false,"pushed_at":"2022-05-20T13:29:07.000Z","size":11,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-12T12:22:18.409Z","etag":null,"topics":["agent","aws","aws-lambda","jvm","jvmti","serverless"],"latest_commit_sha":null,"homepage":"","language":null,"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/serkan-ozal.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-19T08:18:13.000Z","updated_at":"2025-01-18T10:44:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"25292f54-b996-4c74-8786-7e739f83cbf4","html_url":"https://github.com/serkan-ozal/stackwriter-serverless","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"3b904961e8f1250d8993e58bd2d3593a175cd731"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkan-ozal%2Fstackwriter-serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkan-ozal%2Fstackwriter-serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkan-ozal%2Fstackwriter-serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkan-ozal%2Fstackwriter-serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serkan-ozal","download_url":"https://codeload.github.com/serkan-ozal/stackwriter-serverless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445651,"owners_count":20939953,"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":["agent","aws","aws-lambda","jvm","jvmti","serverless"],"created_at":"2024-10-09T20:08:00.878Z","updated_at":"2026-04-30T10:06:04.570Z","avatar_url":"https://github.com/serkan-ozal.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# stackwriter-serverless\n\n![license](https://img.shields.io/badge/License-Apache_2.0-blue.svg)\n![maven-version](https://img.shields.io/maven-central/v/net.sozal/stackwriter)\n![layer-version](https://api.globadge.com/v1/badgen/aws/lambda/layer/latest-version/us-east-1/273094347961/stackwriter) (badge powered by [Globadge serverless](https://www.globadge.com/badges/serverless))\n\n`StackWriter` allows developers to be able to get, manipulate and send/report callstacks (frames in the stacktraces)\nwith local variables (name, type and value) manually (by programmatic API) or automatically (on error).\n\n## Supported Environments\n\n| Architecture/Runtime | `java8`            |  `java8.al2`       | `java11`           |\n|:---------------------|:------------------:|:------------------:|:------------------:|\n| **`x86_64`**         | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| **`arm64`**          | :x:                |     :x:            |  :x:               |  \n\n## Installation\n\n`StackWriter` serverless has 2 components (Agent and API) need to be installed:\n\n- Add agent as layer into your AWS Lambda function:\n```\narn:aws:lambda:${region}:273094347961:layer:stackwriter:${layer-version}\n```\n\nYou can use the version shown below instead of `$layer-version}`:\n\n![layer-version](https://api.globadge.com/v1/badgen/aws/lambda/layer/latest-version/us-east-1/273094347961/stackwriter) (badge powered by [Globadge serverless](https://www.globadge.com/badges/serverless))\n\n- Add API as `provided` (no need to bundle it with the artifact as it is also available on AWS Lambda environment through by layer) dependency into your project:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003enet.sozal\u003c/groupId\u003e\n    \u003cartifactId\u003estackwriter-api\u003c/artifactId\u003e\n    \u003cversion\u003e${stackwriter.version}\u003c/version\u003e\n    \u003cscope\u003eprovided\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nYou can use the version shown below instead of ${stackwriter.version}.\n\n![maven-version](https://img.shields.io/maven-central/v/net.sozal/stackwriter)\n\n- Configure AWS Lambda function to use agent:\n\n### `java8` (Java 8 on Amazon Linux) Runtime\n- Set runtime to `Custom runtime`.\n\n**Note:** `Custom runtime on Amazon Linux 2` is not supported yet.\n\n### `java8.al2` (Java 8 on Amazon Linux 2) Runtime\n- Set `AWS_LAMBDA_EXEC_WRAPPER` environment variable to `/opt/stackwriter_wrapper`.\n\n### `java11` (Java 11 on Amazon Linux 2) Runtime\n- Set `AWS_LAMBDA_EXEC_WRAPPER` environment variable to `/opt/stackwriter_wrapper`.\n\n## Usage\n\n### Getting callstack\n```java\nimport net.sozal.stackwriter.api.StackWriter;\nimport net.sozal.stackwriter.api.StackWriter;\nimport net.sozal.stackwriter.api.domain.Frame;\n\n...\n\nSystem.out.println(\"FRAMES:\");\nfor (Frame frame : StackWriter.takeSnapshot()) {\n    System.out.println(\n        String.format(\n            \"  - %s#%s@%d\",\n            frame.getClazz().getName(),\n            frame.getMethod().getName(),\n            frame.getLine()));\n   Map\u003cString, LocalVariable\u003e locals = frame.getLocals();\n   for (LocalVariable local : locals.values()) {\n        String localVarName = local.getName();\n        Class localVarType = local.getType();\n        Object localVarValue = local.getValue();\n        System.out.println(\n            String.format(\n                \"    + %s: type=%s, value=%s\",\n                localVarName, localVarType, localVarValue));\n    }\n}\n```\n\n### Getting callstack from given start depth\n```java\nStackWriter.takeSnapshotWithStartDepth(2);\n```\n\n### Getting callstack with the frames at most as given max frame count\n```java\nStackWriter.takeSnapshotWithMaxFrameCount(10);\n```\n\n### Getting callstack from given start depth with the frames at most as given max frame count\n```java\nStackWriter.takeSnapshot(2, 10);\n```\n\n## Roadmap\n\n- Automatically collect callstack on error (all errors or specified errors)\n- `arm64` support\n- Ability to send collected callstack to remote services (Webhook, Elasticsearch, Prometheus, etc ...)\n\n## Contributing\n\nEveryone is very welcome to contribute to this repository.\nFeel free to [raise issues](https://github.com/serkan-ozal/stackwriter-serverless/issues)\nor to [submit Pull Requests](https://github.com/serkan-ozal/stackwriter-serverless/pulls).\n\n## License\n\nLicensed under [Apache License 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkan-ozal%2Fstackwriter-serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserkan-ozal%2Fstackwriter-serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkan-ozal%2Fstackwriter-serverless/lists"}