Skip to content

Commit f9fcb19

Browse files
committed
init repo
1 parent d5f1c78 commit f9fcb19

46 files changed

Lines changed: 4242 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.jar
15+
*.war
16+
*.nar
17+
*.ear
18+
*.zip
19+
*.tar.gz
20+
*.rar
21+
22+
# virtual machine crash logs
23+
hs_err_pid*
24+
replay_pid*
25+
26+
# Maven
27+
target/
28+
pom.xml.tag
29+
pom.xml.releaseBackup
30+
pom.xml.versionsBackup
31+
pom.xml.next
32+
release.properties
33+
dependency-reduced-pom.xml
34+
buildNumber.properties
35+
.mvn/timing.properties
36+
.mvn/wrapper/maven-wrapper.jar
37+
38+
# Gradle
39+
.gradle
40+
build/
41+
!gradle/wrapper/gradle-wrapper.jar
42+
!**/src/main/**/build/
43+
!**/src/test/**/build/
44+
45+
# IntelliJ IDEA
46+
.idea/
47+
*.iws
48+
*.iml
49+
*.ipr
50+
out/
51+
!**/src/main/**/out/
52+
!**/src/test/**/out/
53+
54+
# Eclipse
55+
.apt_generated
56+
.classpath
57+
.factorypath
58+
.project
59+
.settings
60+
.springBeans
61+
.sts4-cache
62+
bin/
63+
!**/src/main/**/bin/
64+
!**/src/test/**/bin/
65+
66+
# NetBeans
67+
/nbproject/private/
68+
/nbbuild/
69+
/dist/
70+
/nbdist/
71+
/.nb-gradle/
72+
73+
# VS Code
74+
.vscode/
75+
76+
# Mac
77+
.DS_Store
78+
79+
# Windows
80+
Thumbs.db
81+
82+

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0-SNAPSHOT] - 2025-11-11
9+
10+
### Added
11+
12+
- Initial CozeLoop Java SDK release
13+
- Core SDK module (`cozeloop-core`) with trace reporting and prompt management
14+
- Spring Boot starter module (`cozeloop-spring-boot-starter`) for seamless integration
15+
- Trace reporting functionality built on OpenTelemetry SDK
16+
- Prompt management with caching and formatting support
17+
- Support for Jinja template engine in prompts
18+
- AOP annotation `@CozeTrace` for declarative tracing
19+
- OAuth JWT and PAT (Personal Access Token) authentication
20+
- Example code demonstrating SDK usage (`examples/` directory)
21+
- Initialization examples (PAT, OAuth JWT, error handling)
22+
- Trace examples (simple, parent-child, trace with prompt)
23+
- Prompt examples (prompt hub, Jinja templates)
24+
- Comprehensive documentation and README files
25+
- English and Chinese (简体中文) README files
26+
- CONTRIBUTING.md guide
27+
- LICENSE file (MIT License)
28+
- Examples README with detailed usage instructions
29+
- Maven multi-module project structure
30+
- Checkstyle configuration for code quality
31+
32+
### Changed
33+
34+
- **Trace Export**: Improved `CozeLoopSpanExporter` to export spans in batches of 25 to remote server
35+
- Spans are now automatically split into batches of 25 before sending to CozeLoop platform
36+
- Enhanced error handling: individual batch failures don't prevent other batches from being exported
37+
- Improved logging with batch-level statistics and detailed error reporting
38+
- Better resilience and observability for trace export operations
39+
40+
### Features
41+
42+
- **Trace Reporting**: Automatic batch reporting of traces to CozeLoop platform
43+
- Multi-level batching: OpenTelemetry BatchSpanProcessor + custom 25-span batches
44+
- Robust error handling with per-batch failure isolation
45+
- Comprehensive logging for monitoring and debugging
46+
- **Prompt Management**: Pull, cache, and format prompts from the platform
47+
- **Spring Boot Integration**: Auto-configuration and AOP support
48+
- **Thread-Safe**: All core components are thread-safe
49+
- **Java 8+ Compatible**: Wide compatibility with Java 8 and above
50+

CONTRIBUTING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# How to contribute
2+
3+
## Set Up Environment
4+
Make sure you have Java installed (version 8 or higher, Java 11+ recommended) and Maven 3.6+.
5+
6+
## Dependencies Management
7+
We use Maven for dependency management.
8+
Install dependencies:
9+
```bash
10+
mvn clean install
11+
```
12+
13+
## Build
14+
To build the project, run:
15+
```bash
16+
mvn clean install
17+
```
18+
19+
## Code Style
20+
We use Checkstyle for code style checking. The configuration file is `checkstyle.xml` in the root directory.
21+
22+
To check code style:
23+
```bash
24+
mvn checkstyle:check
25+
```
26+
27+
## Running Tests
28+
To run all tests:
29+
```bash
30+
mvn test
31+
```
32+
33+
## Project Structure
34+
- `cozeloop-core/` - Core SDK module
35+
- `cozeloop-spring-boot-starter/` - Spring Boot integration module
36+
- `examples/` - Example code demonstrating SDK usage
37+
38+
## Submitting Changes
39+
1. Fork the repository
40+
2. Create a feature branch
41+
3. Make your changes
42+
4. Ensure all tests pass
43+
5. Ensure code style checks pass
44+
6. Submit a pull request
45+

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

0 commit comments

Comments
 (0)