
--------------------------------------------------------------------------------
# Changes for 0.5.0 - 20260119

## new

### Go 1.18 version required
The minimum Go version for the go-api module has been upgraded from 1.17 to 1.18.
This is required for implementing Wrap functions using Go 1.18 Generics.

Note: go-api v0.5.0 cannot be used with Go 1.17 or earlier versions.

### Active Stack feature
Implemented Active Stack feature with the same structure as the Java agent.
Collects goroutine stacks of running transactions in real-time to analyze bottlenecks.

Configuration:
- active_stack_enabled=true (default: true)
- active_stack_second=10 (collection interval in seconds)
- active_stack_count=100 (maximum collection count)

### Transaction-linked log collection (TraceLogWriter)
Added TraceLogWriter that automatically links transaction information of the current goroutine when outputting logs.

Usage:
```go
import "github.com/whatap/go-api/logsink"
log.SetOutput(logsink.GetTraceLogWriter(os.Stderr))
```

Features:
- Automatic transaction context linking based on goroutine ID
- Backward compatibility with existing GetWriterHookStderr()
- Enabled with logsink_trace_enabled=true (default)

### Auto-instrumentation tool whatap-go-inst
Supports Go AST-based source code auto-instrumentation CLI tool.
Automatically injects whatap/go-api monitoring code at build time without modifying source code.

Installation:
```bash
go install github.com/whatap/go-api-inst/cmd/whatap-go-inst@latest
```

Usage:
```bash
whatap-go-inst init
whatap-go-inst go build ./...
```

Supported libraries:
- Web: Gin, Echo, Fiber, Chi, Gorilla Mux, net/http, FastHTTP
- DB: database/sql, sqlx, GORM (gorm.io, jinzhu)
- Redis: Redigo, go-redis (v8, v9)
- NoSQL: MongoDB, Aerospike (v6, v8)
- Message Queue: Sarama (IBM/Shopify)
- RPC: gRPC, Kubernetes client-go
- HTTP Client: http.Get/Post, http.Client
- Log: log, logrus, zap

### Supported libraries

New in v0.5.0:
- go-redis v9 (github.com/redis/go-redis/v9) - whatapgoredis
- go-redis v8 (github.com/go-redis/redis/v8) - whatapgoredis
- sqlx (github.com/jmoiron/sqlx) - whatapsqlx
- MongoDB (go.mongodb.org/mongo-driver) - whatapmongo
- Aerospike (github.com/aerospike/aerospike-client-go) - sql.Wrap
- fmt.Print family (fmt) - whatapfmt

## bug

### Fixed LineBuffer.Append() bug
Fixed a bug in the LineBuffer.Append() function during log collection.

### Removed deprecated mongo.NewClient usage
Removed deprecated mongo.NewClient usage in whatapmongo and changed to mongo.Connect.

### Fixed URL path "/" being converted to empty string
Fixed an issue where the trailing slash of URL path was removed due to filepath.Join function usage, causing "/" path to be converted to empty string.

Affected scope:
- trace/Trace.go: net/http handler
- whatapfasthttp/fasthttp.go: FastHTTP handler

Fix: Use string concatenation instead of filepath.Join (r.Host + r.RequestURI)

## update

### Improved goroutine ID based transaction tracking
Improved to find TraceContext using goroutine ID even when context is nil.
Changed go.use_goroutine_id_enabled default value from false to true.
SQL and HTTP transaction linking works correctly in environments where context is not passed.

### Generic Wrap[T] function implementation (Go 1.18 Generics)
Added generic Wrap functions utilizing Go 1.18 Generics.

Supported functions:
- trace.Wrap[T]: General function wrapping
- trace.WrapError[T]: Error-returning function wrapping
- trace.WrapVoid: Void function wrapping
- sql.Wrap[T]: SQL execution function wrapping
- httpc.Wrap[T]: HTTP client function wrapping
- method.Wrap[T]: Method call wrapping

### MongoDB driver support added (whatapmongo)
Supports instrumentation for go.mongodb.org/mongo-driver library.
- mongo.Connect → whatapmongo.Connect

### go-redis v8 support added
Supports instrumentation for github.com/go-redis/redis/v8 library.
Added v8 support in addition to existing v9 support.

### HTTP client mtrace header support added
Automatically adds mtrace header for multi-transaction tracking when making HTTP client calls.

### go-redis v9 instrumentation support added
Supports instrumentation for github.com/redis/go-redis/v9 library.

Supported functions:
- redis.NewClient → whatapgoredis.NewClient
- redis.NewClusterClient → whatapgoredis.NewClusterClient
- redis.NewFailoverClient → whatapgoredis.NewFailoverClient
- redis.NewRing → whatapgoredis.NewRing

Features:
- Hook-based Redis command tracking
- DB connection tracking (StartOpen) included

### sqlx instrumentation support added
Supports instrumentation for github.com/jmoiron/sqlx library.

Supported functions:
- sqlx.Open → whatapsqlx.Open
- sqlx.Connect → whatapsqlx.Connect
- sqlx.ConnectContext → whatapsqlx.ConnectContext
- sqlx.MustConnect → whatapsqlx.MustConnect
- sqlx.MustOpen → whatapsqlx.MustOpen

### DB connection tracking (StartOpen) added
Added functionality to monitor database connection timing. (SQL_TYPE_DBC)

Applied targets:
- whatapgorm: Open/OpenWithContext
- whatapredigo: Dial/DialContext/DialURL/DialURLContext
- whatapgoredis: DialHook
- whatapsql, whatapsqlx: Already applied

--------------------------------------------------------------------------------
# Changes for 0.4.6 - 20251124

## bug

### Fixed agent name pattern environment variable handling bug
Fixed an issue where environment variable values in agent name patterns were not being processed correctly.

**Description**
The {env.VARIABLE_NAME} pattern in object_name setting now properly reflects environment variable values in the agent name.

**Example**
Configuration:
  object_name={env.SERVER_NAME}-{pid}

Environment variable:
  SERVER_NAME=web-server-01

Result:
  Agent name: web-server-01-12345

## update

### Feature Log Stdout output
Added the ability to output logs to both file and stdout simultaneously.

* log_stdout_enabled Boolean
Default: false
Output logs to stdout in addition to file. Supports stdout logging even if file creation fails.

### Feature {pid} pattern support in OID
Added {pid} pattern support in app_name configuration to include process ID in oname.

Example configuration:
app_name=myapp-{pid}

Result:
oname: myapp-12345

### Feature HTTP Status statistics
Added transaction statistics by HTTP status code with 5-second and 5-minute intervals.

5-second statistics (MeterStatus):
- Count/time aggregation by HTTP status code
- Bucket aggregation by 200/400/500 series
- Detailed aggregation by individual status code

5-minute statistics (StatTranxStatus):
- Count/time/error aggregation by URL + Status combination
- Sent to server every 5 minutes

Configuration options:
* tx_status_meter_enabled Boolean
Default: true
Enable 5-second statistics

* stat_txstatus_enabled Boolean
Default: true
Enable 5-minute statistics

* stat_txstatus_max_count Int32
Default: 10000
Maximum number of items in 5-minute statistics

### Feature Kubernetes container ID integration
Added functionality to accurately integrate container IDs in Kubernetes environments.

Add the following environment variables to run containers in Kubernetes:

```yaml
  env:
    # Execute this file to inject the container ID
    - name: WHATAP_GO_AGENT_PATH
      value: /usr/whatap/agent/whatap_agent_static
    # The container ID is generated as container.conf, and the container ID from this file is used thereafter
    - name: WHATAP_CONTAINER_CONF_PATH
      value: /usr/whatap/agent
```

--------------------------------------------------------------------------------

# Changes for 0.4.0 - 20240619

## Bugs

* Corrects an error where the IP of the server where the agent is installed is collected as 127.0.0.1. 
	* Collects local address IP information connected to the WhaTap server via TCP.

## Update

### Supports linux aarch64.  

### Add security.conf. 

* Use security.conf file instead of existing paramkey.txt. 
* Use the value of the paramkey key in security.conf. 
* The default value is changed to specify “WHATAP” instead of a random value. (If “WHATAP” is specified, decryption is possible without key input.)
   
### Change the normalization option settings for SQL statements. 

* Always activate the function to separate and normalize parameters in SQL statements. 
	* Always set the trace_sql_normalize_enabled option to true. 
* If you have already disabled the normalization option (normalization stop setting), activate the setting to normalize and display parameters separately. 
	* Enable the profile_sql_param_enabled option.
	* Normalized parameters are separately encrypted and collected. 
	* You can check the data by decrypting it with the paramkey of security.conf. 	

### Reorganize the ability to stop monitoring.  

* If there is no trace.Init() function call (comment and delete), the monitoring function will not start. 
*Enabled option setting.(true) Stops the information collection feature. The agent's internal background module is maintained. 
* Set shutdown option (true) Stops all agent functions. To restart, you need to change the shutdown option to true and restart the application.


--------------------------------------------------------------------------------

# Changes for 0.3.2 - 20240306

## Update

### Changed log monitoring file names to use variables in date format.
    - Based on python strftime usage.
    * Example) 20240101: %Y%m%d
    
## bug

### Fix gprc header collection error.

--------------------------------------------------------------------------------
# Changes for 0.3.1 - 20240124

## Update

## bug

### Fixed an error where only the hash (number) value, not the name, was displayed after setting onode_name.
    * The original text and hash data type were incorrect, so the original text was not displayed.

### Fixed an error where the whatap-agent.service file was not recognized in Ubuntu 14 version.
    * Add /etc/systemd/system/whatap-agent.service file. (link /usr/lib/systemd/system/whatap-agent.service)    

--------------------------------------------------------------------------------

# Changes for 0.3.0 - 20240110

## bug
### Change mcaller in HttpCall step to caller stepid.

## update

### Supports Trace context (W3C).
* Supports trace contact in multi-transaction tracing.
* Supports multi-transaction tracking linkage with Opentelmetry.
 
### Supports Trace context (W3C).
* Supports trace contact in multi-transaction tracing.
* Supports multi-transaction tracking linkage with Opentelmetry.
    
### Fixed the collection of resource indicators for Sql, Method, and Http call.
* Collect the difference between resources (cpu, mem) at the start of the transaction and the start time of each step.
* In case of SQL resource, it is collected as (sql start resource - transaction start resource).

--------------------------------------------------------------------------------
# Changes for v0.2.4 - 20231122

## bug

### Fix whatap-agent service execution error in CentOS 9 and above
### Fixed the issue of duplicate vCpu information collection in Docker container environment
### Fixed an error in which ports were collected together while collecting client IP addresses.

## update

### Change the text cache storage period from one day to one hour.
### Changed to not collect cpu and memeory metrics in the Kubernates environment, replacing them with system metrics collected by the Kubernates agent

--------------------------------------------------------------------------------
# Changes for 0.2.0


## Update

### Change the agent configuration method

Changed to set whatap.conf on a per-process basis.
Whatap.conf must be pre-generated before running the process.
/usr/whatap/agent/whatap.conf used in the existing setup only uses the whatap-agent service.


### Agent IPC communication changed from UDP to TCP

The net_udp_host and net_udp_port options remain as they were.
Added net_ipc_host, net_ipc_port options are also available.
By default, IP 127.0.0.1 and port 6600 are used.
To change, after changing the user App and whatap-agent service configuration file, it will be applied after restarting.


### Change agent naming convention

Existing {type}-{ip2}-{ip3}-{process}
change {type}-{ip2}-{ip3}-{cmd}-{cmd_full}
cmd is the process name. The execution args[0] value.
cmd_full processes all lines of the execution command as hash values. . All of the execution args.
Agent names can be duplicated when using the same process and arguments.
In this case, you can customize the app_name setting in whatap.conf. (A restart is required after specifying.)

### Change memory usage

Memory usage is displayed as the sum of `HeapInUse` and `StackInUse` items inside `runtime.MemStats`.

--------------------------------------------------------------------------------
# Changes for 0.1.14
Release date: December 14, 2022

Fixed Fixed the problem where the CPU usage increases while the UDP server is stopped.
While the UDP server is stopped (whatap-agent service stopped), the CPU load of the application with the Golang monitoring applied increases. As the UDP server access and shutdown processes were repeated, multiple UDP connections were maintained, resulting in the increase of CPU usage.

## New The k8s.io/client-go/kubernetes library has been supported.

## New The github.com/gofiber/fiber/v2 library has been supported.

## New The github.com/valyala/fasthttp library has been supported.


--------------------------------------------------------------------------------
# Changes for 0.1.13
Release date: 2022-08-31

## Update  

### Collection of the Cloud environment data  
It briefly gathers data from the Cloud environment.

--------------------------------------------------------------------------------
# Changes for 0.1.12
Release date: 2022-05-26

## Update

### The Alpine Linux is supported.

### Supporting the github.com/go-chi/chi library
It traces the web transactions in the chi framework. Through the Use function, register and trace the middleware.

### Supporting the github.com/go-gorm/gorm library
It traces the DB connection and SQLs processed through the gorm v2 framework.


### Supporting the github.com/jinzhu/gorm library
It traces the DB connection and SQLs processed through the gorm v1 framework.
### Supporting the github.com/gomodule/redigo library  
It traces commands passed to Redis via the redigo framework. Instead of redis.Dial, the whatapredigo.DialContext function is used.


### Supporting the github.com/shopify/sarama library  
It traces the kafka produce and consume events processed through the sarama framework.


--------------------------------------------------------------------------------

# Changes for 0.1.11
Release date: 2022-05-26

##  bug fixing

### Correction of the parameter collection error  
For collection of internal parameters, the ParseForm() function call in http.Request has been deleted. By calling the function in advance, an error occurs later when accessing the body or parameters of the multipart/form-data type.

At the end of transaction, it has been modified to only retrieve the contents of request.

## update

### Database/SQL transaction-related modification  
Inside the database/SQL driver, for Begin(), BeginTx(), Commit(), Rollback(), and Close() functions, the part that was collected in the form of SQL statement is now collected as a general message. It is retrieved only in the transaction profile data.

In Statistics > SQL Statistics, it is no longer viewed.

### Collecting errors not included in the web transaction  
In case of web transactions in the past, the error data was collected only when the context includes WhaTap data (trace.Start() call required) and the unique transaction ID (Txid) was granted.

If there is no unique transaction ID, the collected data can be retrieved from only the statistical data.

### Collecting error.(Type) data upon error collection  
Error statistics are divided into two parts: class and message. In the past, error.Error() messages were collected equally as classes and messages.

As shown below, error.(Type) is collected in the class, and error.Error() is collected in the message.

Class	Message
*errors.errorString	custom panic
*errors.errorString	mysql: driver does not support the use of Named Parameters
mssql.Error	mssql: Incorrect syntax near '1'.
*echo.HTTPError	code=404, message=Not Found

--------------------------------------------------------------------------------
# Changes for 0.1.10
 
## Close Beta

## Update

### Collects SQL and HTTP call information not included in web transaction.

In the case of web transactions, SQL and HTTP call information were collected only 
when whatap information was included in context (trace.Start() call is required) 
and a unique transaction ID (Txid) was issued.

If there is no unique transaction ID, 
the collected information can be viewed only in statistical information.

--------------------------------------------------------------------------------
# Changes for 0.1.9
 
## Close Beta

## Fixed

### Fixed an error where web transaction information could not be collected in a panic situation.

## Update

### Collect http status code.
### github.com/labstack/echo 

* Support for echo/v4
* Add HTTPErrorHandler Wrapper for echo.

### log output

If the debug option is set, monitoring related logs are output.

### Add setting to ignore transaction collection of specified http method.

**`ignore_http_method_urls`**
    Default : "" 
    Type : String 

**`ignore_http_method`**
    Default : "" 
    Type : String 

```
ignore_http_method_urls=/index, /sql/select
ignore_http_method=options, connect
```

--------------------------------------------------------------------------------
# Changes for 0.1.8 - 20220119

## Close Beta

## Update

### Added concurrent user collection setting.

### Active status

The active status graph is displayed on the dashboard screen. 
Status includes general function, SQL, DB connection, external HTTP connection, 
and socket connection, and each status displays the number of requests in progress.

### Collect runtime metrics

### Supports RoundTripper from net/http library.
--------------------------------------------------------------------------------
# Changes for 0.1.7 - 20220104

## Close Beta

## Update

### Supports the database/sql library.

### Supports the github.com/go-gonic/gin library.

### Supports the github.com/gorilla/mux library.

### Supports the github.com/labstack/echo library.


--------------------------------------------------------------------------------
# Changes for 0.1.6 - 20211123

## Close Beta

## Update

### Supports the google.golang.org/grpc library.


--------------------------------------------------------------------------------
# Changes for 0.1.5 - 20220901

## Close Beta

## Update

### Basic API configuration and net/http related API configuration
